Struggling to apply basic conditional logic to send data to google sheets

What are you trying to achieve?

Hi all, I’m new here. Trying to create a logic to send form data into 3 different sheets within google spreadsheet. It is probably a simple logic but too much for a newbie. :slight_smile:
Thank you in advance for your help

Steps taken so far

I have tried applying logic using variables and increment counters but nothing seems to be working. I was hoping to create a variable such as sheet count then increment that each time data is received and reset after 3 (which is the total number of sheets)

Screenshots: scenario setup, module configuration, errors

blueprint (1).json (95.5 KB)

I’m not sure what you’re trying to achieve with this counter. If the counter parts are removed, each time a webhook comes in, it will automatically go down each route of your Router and add a row to each sheet. I might be missing something you have planned later for that counter, but it seems unnecessary right now.

Routers can have filters on each route, but they are optional. If no filter is set on a Route, then your automation will always go down that path. Once it has finished executing all modules on that path, it will go back to the Router and try to go down the 2nd path to the end etc. Filters on those paths just prevent execution on that path if the filter criteria are not met, so form a good way to add logic to your automation. But no filters, it’ll just go down each Route in sequence.

If you want to have a 4th path that only executes after the 3 Sheets have had a Row added, that automatically happens by default, if the 4th Route is placed in the 4th position, which on your current blueprint, it is.

Thank you for your response. For the sake of simplicity I have removed the 4th path. What I am trying to achieve is to have a flow where a row gets inserted in Sheet1 when the scenario runs for the firs time. After that, each time the form submission data comes in, it gets routed to the next Sheet e.g. Sheet2, then finally to Sheet3 when the form is submitted the 3rd time. But on the 4th submission, it should start from Sheet1 again hence creating a loop/cycle.

Does the ‘order router’ feature on the router not automatically routers the data in an order to each sheet one at a time? It doesn’t seem to be working in this case. Each time a form is submitted, it adds a row to all 3 sheets at once. I think I am missing the conditional logic that would allow me to send the data one by one to the sheets then reset. Hope that make sense. Thanks again in advance.

blueprint (2).json (87.5 KB)

The difficultly is that Free and Core plans don’t allow you to store variables that be retrieved in a later execution. Instead, the easiest way to store data between executions is with a Data Store:


Your datastore will only have 1 record, which keeps track of which sheet was last updated. You then use the route filter to check the value of last_sheet and send to the relevant path. Then you update the record with the sheet number that was just used.

blueprint (23).json (104.7 KB)

You need to enable Sequential Processing in the scenario settings to avoid multiple exections running at the same time, as this could cause out-of-sync executions.

An alternative to a Data Store is to use another place in your Sheet to store this, but you’ll use the same number of operations either way.

Sorry, I have been away hence I haven’t had a chance to work on this automation. Thanks for sharing the blueprint. It appears the data is not flowing through to the router and the automation stops when the data is passed from webhook to Data store that search the records. I have enabled Sequential Processing. Can’t figure out what I’m doing wrong?