- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 04:54 AM
Monring!
I am experiancing an issue with a list collector displaying the SYS ID instead of the display value.
I have a list collector in a record producer that is using local choices (question_choice). This needs to log teh value and then map it into a list collector on the demand record that the record producer creates.
When this happens, it is placing the SYS ID into this field, instead of the display value.
Any assistance would be greatly appriciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 09:12 AM
use below code in record producer script
var sys = producer.u_impacted_other_cross_functional_teams;
var list =[];
var gr = new GlideRecord('question_choice');
gr.addQuery('sys_id', 'IN', sys);
gr.query();
while(gr.next()){
list.push(gr.value.toString());
}
current.u_impacted_other_cross_functional_teams=list.toString();
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 06:13 AM
Yes I am able to see them properly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 06:12 AM - edited 02-10-2023 06:19 AM
@Patrick Slatter Found the issue in demand table that is list collecter with choice values right
so remove map to field in variable
in record producer script write this
var sys = producer.u_impacted_other_cross_functional_teams;
var list =[];
var gr = new GlideRecord(“question_choice”);
gr.addQuery(‘sys_id’, ‘IN’, sys);
gr.query();
while(gr.next()){
list.push(gr.value.toString());// only one thing go to question choice table and check in which backend value is there like name or value give that here
}
currrent.u_impacted_other_cross_functional_teams=list;// if list not worked try list.toString()
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 06:33 AM
removed map to field in variable
Should lines 7 and 19 be commented out as well?
Also when adding your script i receive an error, both with using double and single quotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 06:37 AM - edited 02-10-2023 06:38 AM
@Patrick Slatter 7 to 15 not needed
in glide record and addquery remove quotes and add again
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 06:46 AM
Commented out 7 and 19
removed quotes from the add query
map to field disabled on the variable
same result
SCRIPT
Result