Getting only first value of list collector in an array

Shweta Maurya
Tera Contributor

Requirement-->In  catalog task "affected ci" field need to set same as catalog variables for every task and in every task the ci is different because the number of catalog task is trigger based on number of asset selected in "catalog variables".

issue->I have written script in flow designer to set affected ci... but it is always setting first asset name in affected ci in all task.

5 REPLIES 5

JenniferRah
Mega Sage

If shortDesc is a list of comma delimited sys_ids, you can skip the array altogether and make your query like this: 

 

hw.addQuery('sys_id', 'IN', shortDesc);

 

Then change your if(hw.next()) line to a while(hw.next()) and that will cycle through all of them.