SYS ID displaying in list collector from record producer

Patrick Slatter
Tera Guru

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!

1 ACCEPTED SOLUTION

BharathChintala
Mega Sage

@Patrick Slatter 

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();

 

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

View solution in original post

19 REPLIES 19

Yes I am able to see them properly 

@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()

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

removed map to field in variable 

PatrickSlatter_0-1676039553427.png

 

 

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 

PatrickSlatter_1-1676039592135.png

 

@Patrick Slatter  7 to 15 not needed

 

in glide record and addquery remove quotes and add again

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

Commented out 7 and 19 

removed quotes from the add query 

map to field disabled on the variable 

same result 

SCRIPT 

PatrickSlatter_0-1676040335027.png

 

Result 

PatrickSlatter_1-1676040364487.png