Flow Designer Array.object for each
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2022 05:53 AM - edited ‎10-18-2022 06:14 AM
Hello!
I'm testing abit with the flow designer but I can't iterate a array of objects.
The flow looks as following images
This is the flow, it's very simple. Action 1 creates an array and puts it in output variable artlist, format Array.Object.
But when I try to iterate through them with the for each item in the created output variable (artlist) I get an error, see next image.
 
 It says that it iterated 0 of 0 in size, but the array should be 2. And In the first step I can check the length and it is 2.
Furthermore when you open the for each step in the error it says "Type" Records, shouldn't this be objects?
When I check the flow logs I get the following:
 
I don't even get to the second step but I will paste it anyway. It should take the object, and try to print the attributes of it.
 
 
I get the same error if I use Array.string and change all inputs/outputs from objects to string.
Any help will be much appreciated
EDIT: All images in order
Flow
 Step 1
 
 Step 2
 
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2022 06:11 AM
I hope you are using json parser in action and if possible can you share the payload .and mention what properties you are trying to access
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2022 06:15 AM
Does it matter what I'm trying to access since the error appears in the for each?
What do you mean with the json parser? I'm creating the array manually. I added images of all steps in the first post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2025 10:42 PM
JSON.parse(manually_created_array);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2025 10:44 PM
I am having sort of similar issue, for each item it is showing 0 of 0, i tried JSON.parse, converted into string and splitting into array, changing the payload itself.
But all in vain, in the end, I added a Log Action, used the script to loop through the JSON payload and did the work as of now.