- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 12:30 PM
Hello all,
Fairly new to SN. I am trying to retrieve the values for a reference variable on an RITM. Any suggestions or links would be much appreciated. I've seen getReference() which isn't working. I am trying to retrieve reference value for Employee Name, which is a sys_user reference.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 12:44 PM
You can dot-walk the values on that reference field:
current.variables.employee_name.name.getValue()
OR
current.variables.employee_name.email.getValue()
Something like that. Is there specific data you are attempting to retrieve from that reference field? Can you please elaborate on your use case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 12:44 PM
You can dot-walk the values on that reference field:
current.variables.employee_name.name.getValue()
OR
current.variables.employee_name.email.getValue()
Something like that. Is there specific data you are attempting to retrieve from that reference field? Can you please elaborate on your use case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2022 07:05 AM
You can do it using the below in a workflow run script:-
current.variables.employee_name.field_name.getValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2022 09:43 PM
Hi,
if you wish to set some other variable based on the reference variable then you can write onChange client script on that and use either
1) getReference() with callback
OR
2) GlideAjax
Can you share your current script configuration and screenshot
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2022 10:03 PM
Hello
as You have mentioned you tried with getReference "I've seen getReference() which isn't working."
so, getReference won't support in Portal that Efficiently. better You go for Client Callable Script Include with onChange Catalog Client Script with GlideAjax.
You can refer
if not please expalin your entire use case in brief:-
based on selection of User, which variables needs to be auto-populated with what data from user table.
Mark my Response as Correct or Helpful, if you find it Appropriate.
Gaurav Shirsat
https://www.linkedin.com/in/gauravshirsat/