Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

array.object not passed into for each loop

Minh2
Tera Expert

Hello All,

With Flow Designer, I am trying to pull devices from a FortiManager and got a payload back and converted into an array.object.  I tried loop through the objects in this array with a For Each loop but when I run the flow, test run output shows that nothing is passed into the For Each loop.

Please see attached screenshot for more info.  I did notice a weird thing, the For Each Item action references variable from action #3 (3 > variable > result_object...), shouldn't it reference #2 instead? thats where it get the array.object from.

I tried deleting the action, deleting the whole flow and create a new one.  Everytime I select the array.object from action #2, it shows 3 > variable... afterward.

Is this a bug?

find_real_file.png

Thank you!

5 REPLIES 5

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Minh,

It's probably not a bug but rather a limitation. I'm able to process 1 dimensional String array but fail to process object array with "For Each Item in" step.

Totally agree Hitoshi.  So what happened was I had a nested array and I tried to loop through a child array first.  I was able to get it to work by loop through the root array first, then the children, then grand-children, etc...

Thanks for your reply

 

Minh

Akshar Roy
Tera Contributor

Hello, Can you please share a screenshot of how looped through "root array first, then the children, then grand-children". Thanks.

 

When I tried For each (child array) within a for each (root array), Flow is not displaying the objects from the child array.

Please see below Akshar, hope this helps

 

Minh2_0-1665585146819.png

 

Minh