- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 12:21 AM
Hi,
I am having a record producer. In which i am having one variable as a reference of table. Now i am storing the record producer values to a custom table. For that reference variable it is storing the record name in the custom table. But i need to store the Sys id of the reference variable's selected record. Can we use getUniqueValue(). Any solution for this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 01:18 AM
Hi,
if you directly map it using Map to field then the target string field will hold sysId
If your users are fine with it then it's fine OR else check script I shared.
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
‎08-11-2022 01:17 AM
But in table column it is a string type. So can i able to store the sys id into the column?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 01:17 AM
Hi,
then use record producer script and get the display value
current.u_target_field = producer.variableName.getDisplayValue();
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
‎08-11-2022 01:18 AM
Hi,
if you directly map it using Map to field then the target string field will hold sysId
If your users are fine with it then it's fine OR else check script I shared.
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
‎08-11-2022 09:57 PM
It was getting sys id now. But what if i have the custom table column type is reference one. The same map to field method stores the name of the record. How to get sys id in that case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 09:58 PM
Hi,
if the target field also refers to same table as that of variable no need to worry.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
