Flow Designer - create array of data

PetrP
Tera Expert

Hello,

  • I have flow.
  • Look up records
  • For Each Item In
  • where I need create one array with all data found
  • Such array needs to be passed out of For Each Item In. I try to handle it via FLOW Variable right after for each....

 

Any advice?

I was able to achieve this but getting always one blank value, dont know why.

Any better way to create comma separate list of data after For Each Accesible later on out of that branch?

 

PetrP_0-1716818257466.png

 

 

PetrP_1-1716818313452.png

 

 

/Petr

1 ACCEPTED SOLUTION

Murthy Ch
Giga Sage

Hi @PetrP 

I believe there is some empty value is getting passed into the array. Write a query to ignore the empty values before pushing into the array. If you stuck please post the code here, I will try to help you out.

 

Thanks,
Murthy

View solution in original post

4 REPLIES 4

Murthy Ch
Giga Sage

Hi @PetrP 

I believe there is some empty value is getting passed into the array. Write a query to ignore the empty values before pushing into the array. If you stuck please post the code here, I will try to help you out.

 

Thanks,
Murthy

Thank you, not sure if I should implement it different but this is what I have now. No Code used yet in flow.

Please review below, any idea how to solve this or implement different?

Goal is to create array from look up records and have that array available o level 1 in flow as below number 5.

 

PetrP_0-1716870767763.png

 

PetrP_1-1716870845396.png

 

Udo Jocher
Tera Contributor

Hi,

I see you have scripted it, but maybe you are interested in the explanation.

On the first iteration you have the loop variable and you add "," and the flow variable that at this point is empty.

So what happens is you got an extra comma at the end, witch gives you the empty element.
What I did in a similar case is an additional assign step like this (see blue fx with Replace String)

UdoJocher_0-1731600066188.png

UdoJocher_1-1731600109615.png

a regex to replace the last ","

 

At the end I scripted this in flow action where I create array, gliderecord query to get all data and push array.