Combining Iterate Tasks & Branch

I’m using the Iterate Task to go through the TableGrid.PROPERTIES.EDITEDTROWS attribute. However, I want to validate each of those rows and impose conditions on them. If a given row is validated, then perform an update on my db. If it doesn’t, then I want to create a Toast to inform the user of the problem. Then repeat for all elements in EDITEDROWS.

It would be great to access the Branch action inside of an Iterate Task action - or perform validations on edited rows before saving the changes and triggering an action flow.

Hi @sean.garvey,

The feature that you are requesting can be achieved by using when to execute block.

Instead of using the branch, we can make use of when to execute section in each action individually. Here the actions required will be the API call and the toast (Here in this example). We can write the specific conditions there in the when to execute section as per our requirement in JS format(within double curly braces), which will decide when to run those particular actions.

Here, I take an example to show an action flow involving the use of iterate tasks, which takes the reference as {{TableGrid.PROPERTIES.EDITEDTROWS}}.

In JS code action, namely transFormUpdateRecord, we take different variable which will be used later in the flow. One of them is Salary variable which will decide whether to run an action or not(Here in this example).

Here we are using the condition if Salary>20000, only then this API call will take place, otherwise not.

Similarly, we can apply the condition for the toast as well.

As per the condition we have applied in the API call and toast, only one of them will run at a time. If the Salary>20000, only API call will take place; otherwise toast will run.

Though I believe you might not be needing it, I hereby share with you the relevant article link.
When to execute in BINDAPI.

I hope this helps.