Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Get the display value of list collector variable values selected through flow designer

Phanideepthi
Tera Contributor

Hi All,

 

We are working on a catalog item where we have a list collector variable("additional services") getting from question_choice table . Now we need to get the values selected in the list collector into request description. When we are adding the variable it is populating with sysID's of the values selected. So now how can we get the text values using a flow designer. 

Phanideepthi_0-1763388943210.png

 

 

Thanks in advance.

11 REPLIES 11

@Ankur Bawiskar ,

 

We are getting sysID as shown

Phanideepthi_0-1763646886768.png

 

@Phanideepthi 

see what comes in these logs

var arr = [];

var val = fd_data._1__get_catalog_variables.need_any_additional_service_account.toString();

gs.info('my value is' + val);

var rec = new GlideRecord('question_choice');

rec.addQuery('sys_id', 'IN', val);

rec.query;
gs.info('row count' + rec.getRowCount());
while (rec.next()) {
    gs.info('inside while');
    arr.push(rec.getValue('value')); // use text field name if you want here

}

return arr.toString();

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader