Dot walking from HR Task to HR Case (current.parent.subject_person.u_pay_grade).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2022 03:47 AM
I have an HR Case, inside that there is an HR task. The HR Task has a field called "Parent" which references the corresponding HR case record. The HR case has a field called "Subject Person" which references a records from a table "HR Profile" with field "Pay Grade".
I want to dot walk in script from HR Task's Parent to HR Profile's "Pay Grade".
In order to do that I am writing the following script "current.parent.subject_person.u_pay_grade". Checked this using gs.log(), but it turns out that this line is getting skipped.
But I am not getting any results. I tried to even dot walk in the Condition Builder, but still I did not get my desired result.
Is there any workaround for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2022 04:03 AM
Hi @Harsh _
Here direct dot walking wont work because of 2 reasons:
1. Parent field on HR Task refers to 'task' table and not HR Case table
2. Subject Person field on HR Case refers to 'sys_user' table and not HR Profile table.
In HR Case, there is different field called "Subject Person HR Profile" which refer to HR profile of Subject Person which we can use.
Please try below dot-walking for your requirement:
parent.ref_sn_hr_core_case.subject_person_hr_profile.u_pay_grade
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2022 10:52 AM
Please try the following code. It shall works:
var grade = new GlideRecord('sn_hr_core_profile');
grade.addQuery('user', current.parent.subject_person);
grade.query();
while (grade.next())
gs.addInfoMessage("My pay Grade is " + grade.u_pay_grade);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2022 12:40 PM
Hi Harsh,
Does my answer help you? If it is helpful/correct, can you mark correct/helpful? This will help us to review similar questions.