The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Flow designer: how can I separate look up records into a list?

astanley
Tera Contributor

Hello, 

I am currently using a for each loop in flow designer to look up records and set a flow variable with the found records

astanley_0-1668637731262.png

The issue I'm facing is when I use this flow variable down the line, it populates the records without separating them:

astanley_1-1668637840092.png

Where I have covered is the start of a new record. Is there any way I can separate the records into a list or at least be separated by a comma? Thanks!

13 REPLIES 13

First I am looking up all records on the hardware table for records assigned to user in trigger:

astanley_0-1668719237182.png

Next I am doing an iteration. For each record found, set the flow variable to the display name:

astanley_1-1668719326215.png

 

 

 

Hey,
Please look at my test flow from a catalog.

Input from catalog is a list collector from cmdb_ci.

SaurabhG_0-1668721043779.png

 

Output on RITM.

SaurabhG_1-1668721113487.png

 

Code of Flow variable


var ret=fd_data.flow_var.ci_string;
var data_ci=fd_data._2__for_each.item.name+"("+fd_data._2__for_each.item.sys_class_name+")";
if(ret)
return ret+", "+data_ci;
else
return data_ci;


Please mark the answer as correct, If I answered your query. It will be helpful for others who are looking for similar questions.

Regards
Saurabh

 

 


Thanks and Regards,

Saurabh Gupta

I tried changing my logic as per you.

SaurabhG_2-1668721671092.png


Below is the output.

 

SaurabhG_3-1668721689884.png

 

 

Please mark the answer as correct, If I answered your query. It will be helpful for others who are looking for similar questions.

Regards
Saurabh


Thanks and Regards,

Saurabh Gupta

There might be some other issue I tried raising a catalog request that is also success.

SaurabhG_0-1668722165628.png

 


Thanks and Regards,

Saurabh Gupta