Flow Designer Foreach loop on Service Catalog List Collector variable type not identified as record (sometimes)

Anders Pr_steg1
Tera Contributor

Hi

I have a Flow Designer Flow that uses the Service Catalog plugin and in that gets Catalog variables one of which is of type List Collector and contains sys_user records. When - in a Flow Designer ForEach Loop - trying to reference the email attribute on each sys_user record iteration, I cannot expand it, and it's titled "Item" while being greyed out as well. At some point during my fiddling around the record was suddenly recognized as a user object though that did revert after a Test run that failed at the specific step where I expand the ForEach user object reference. 

Can anyone share any insight on the matter?

Thanks,

Anders

1 ACCEPTED SOLUTION

No problem, I'm still a newbie so if this doesn't work, apologies!

So my example is, I have a Service Request that captures multiple accounts within the list collector. We then use this to generate flows and processes for each value in the list collector, so need to be able to select values from the accounts table.

Mine goes (screenshot attached too):

Trigger - Service Catalog

Action 1 - Get Catalog Variables from [Request Item] (pulls in List Collector field)

Action 2 - Look Up [Account] Records where Sys ID = [List Collector Field (from Action 1)] 

Action 3 - For Each [Account Record] (from Action 2)

For me, this kept the 'For Each' record as the Account Record, that I could expand and take the data pills from when needed.

View solution in original post

16 REPLIES 16

AndyH_wood
Tera Contributor

Thanks for pointing me to this post Anders (and your guide Natalie). Works a treat for subsequent actions within Flow Designer. Thank you.

Andy

CristianG1
Tera Contributor

Thanks, Natalie, your PNG file was very helpful!

manish123
Giga Guru

Hi Anders,

I have a query, My requirement is to set the variable value in RITM for the specific Catalog Item.

I created the trigger as Service Catalog, Action Get Catalog Variable from HR Job Profile (Catalog Item). And selected all the variables there too. But got stuck in the step to set the variable's value.

Suppose, I have a checkbox variable i.e. "ABC" and like to set "True".

I tried with Run Script but still no luck.
var nameOfABCVariable = fd_data._1__get_catalog_variables.abc.getName();

gs.log("abc name: " + nameOfABCVariable);

In log, it's printing as undefined.

However, if I used like this then it returns as true even it is not defined by the user in the RITM record.
var nameOfABCVariable = fd_data._1__get_catalog_variables.abc;

gs.log("abc name: " + nameOfABCVariable);

Therefore, could you please guide or help in setting this up or is there any example available then kindly share.

Quick help must be appreciated.

GeoffreyOptumOp
Tera Expert

Does NOT seem to be working for me, in Rome version.  Did I mess something up?

Here is my "v_group_type" definition of type List Collector:

And here is my flow:

Nothing gets logged.  No iterations.  Even though I know there are 2 group types.

GeeYan
Tera Contributor

It seems like when the RITMs are created it doesn't link it to the existing Parent REQ