Is it possible to get the sysids of the values in a list collector in flow designer?

donnadavis
Tera Expert

I have values in a list collector and some of the values contain commas.  For example, Bugs Bunny, MD or Looney Tunes Practice, PLLC.

I have been able to get a script working that uses the DIsplay Value from the list collector.  I use the names to call a custom table to get more information for the catalog task.  Splitting the values is a problem for those that have commas as part of their name.

I have tried to get the sysids instead and have had no luck.  I used the following

var cdonna = fd_data.trigger.request_item.variables.ci_practices;

and it returns

cdonna = com.glide.vars2.Variable@d2697e

Ankur Bawiskar helped me tremendously in identifying what I needed to access the variables.  I am hoping that there is something special that is needed in FLow Designer to access the sysids.

Thanks for any information you can provide.

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Donnadavis,

I am assuming you are trying to get sysId value after the step Get Catalog variable action. If yes then replace fd_data.trigger.request_item.variables.ci_practices; with

type fd_data. in the script editor and you will get option to select get catalog variable set ->Select that->After that type (dot i.e .) and you will see the variable and select that

Reference ; 

fd_data._1__get_catalog_variables.lc //_1__get_catalog_variables is my first step get catalog variables.

View solution in original post

8 REPLIES 8

Hi,

you will have to query and get the value

var sysId = fd_data.trigger.current.sys_id;

var gr = new GlideRecord('sc_req_item');

gr.addQuery('sys_id', sysId);

gr.query();

if(gr.next()){

return gr.variables.teams_members.getDisplayValue();

}

Regards
Ankur

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

Hi @Ankur Bawiskar , 

 

It returning and Internal Error 

find_real_file.png

find_real_file.png

try this

var sysId = fd_data.trigger.request_item.sys_id;

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

@Ankur Bawiskar  yes! that works. 

Posting the final code here for others 

var sysId = fd_data.trigger.request_item.sys_id;
var gr = new GlideRecord('sc_req_item'); // Table that I am query
gr.addQuery('sys_id', sysId);
gr.query();
if(gr.next()){
return gr.variables.teams_members.getDisplayValue(); //teams_members is the name of my variable 
}