Custom path for loop items

Hello guys,

This is just a simple tutorial on how to use “Custom path” for loop inputs, we will be adding a method to automatically choose properties of a loop item soon, but until then this is here to help out those in need at the moment.

basically, the custom path input allows you to choose whichever property you need within a loop item, now the loop item itself depends on the list you are looping through, so let’s say you tested a step that resulted in a list of items to loop like this:
image

image

and you add a loop and insert it in the “items” input:

and within it you want to access the property x, to do so we do this:

now let’s disect the path, first is the loops step programatical name “step_2” then we add a “.” to access “item” after that we can access properties of the current item and as you can see in the first image we have properties like x and y, and we have z which
is nested here is how to write the custom path for these:

  1. step_2.item.x
  2. step_2.item.y
  3. step_2.item.z.a

if your item had a property with spaces or starts with numbers we have to use this notation instead:

step_2.item[‘x is a nice letter’]

Note: if you can’t see the images you can right click and open them in new tab to see them clearer :slight_smile:

Many thanks! My flow works now

1 Like

I am trying to use the loop in an array returned by MySQL connection its format is [{obj1},{obj2},{obj3}]
I want to loop each object to be written in a new google shit each object be appended to a new row

whatever I do it only returns the 1st row only. what is the solution?

Hello @Darbaz_Dara , Welcome to the community :star2:.

If you test Google Sheets step (which is inside loop) , it may only insert one row so that you can map values in Google Sheets columns.

After mapping values, please try to run entire flow by clicking Test Flow above trigger. All MySQL object values will be inserted in Sheet.

Let me know if you face any issue.

2 Likes

Hello @Abdul , can you show us the screen of what you have done to have this result in the first screen ? I’m new here, and I try to do a loop with 3 iterations with no succes.

Hello @Aurelien_MAILLET ,

Could you provide details about your workflow that would facilitate the troubleshooting the issue? In first screen, code piece is used to create array/list data that can be used for next Loop step.

Thanks, I think I have resolved my issue with the AI assistant. I have that now if it can help