Based on the loop iteration value, I want specific workflow branches to run

Hello, Knime 4.7.7 user here. I use the ‘table row to variable loop’ followed by certain nodes which transform the data. I want to write this data into a google sheets file. The first iteration should clear the sheet/tab within the file (lets call this sheet/tab dummy1) and write the first set of data. From the second iteration onwards, the data should be appended to the data already present in dummy1.

Ideally, I want a solution where I can easily change the iteration counts for example I might need to write the first 5 iterations in different sheets/tabs and the other iterations should be appended based on the variable.

@nallich you can use flow variables to steer the behaviour within a loop. For example handle the first iteration differently

You can read more about loops here:

5 Likes

Thank you, this worked. I used a switch case + the java node and it worked perfectly.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.