- 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 12:29 AM
Hello
so if i understood it correctly you want the sys_id of the reference variable instead of name while mapping ?
how are you mapping it to custom table field and what type of field is storing the name of the referenced record can you tell me that ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 01:15 AM
Yes i want the sys_id of the reference variable's value. And I was mapping it via map to field to the column in the table. And the column type is string only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 01:21 AM
OKay then try to do this in your record producer script and remove map to field .
Your below line will map it to you can remove map to field
current.your_field_name = producer.your_reference_variable_name
this will store the sys_id of it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 12:33 AM
Hi,
to which target field you want the variable to be mapped?
the target field can be reference type and referring to the same table as that of the variable and you can directly map it
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
