Apps Script Return Value in automation works only for last row

Hi, 

i have an automation, that triggers a App Script for each row and sets the return value to a colum "c" in the next step.

m_guenther_1-1679734372796.png

m_guenther_0-1679735917219.png

 

m_guenther_1-1679735073015.png

m_guenther_0-1679736009462.png

 

 

m_guenther_2-1679734447212.png

 

m_guenther_0-1679734312279.png

 

But the return value is only stored for the last row:

m_guenther_0-1679735020926.png

 

https://docs.google.com/spreadsheets/d/1h3lPn2BmuEBImosCxxw85V--okkahVGISWW0B3i4XIY/edit?usp=sharing

Whats wrong?

Thank you!

Solved Solved
0 7 758
1 ACCEPTED SOLUTION

Hello @m_guenther 

I can confirm this. I too had an automation that returns a unique value for row of the table. Like wise it was triggered by schedule and like wise i only got 1 return.

My hypotesis way the trigger, given it was just 1 bot it would probably return 1 value(?)

To fix this on my case. I had to do some extra steps.

1. Create another column on my target table called "trigger"

2. Call a scheduled trigger to just add 1 on all my target table's  "trigger" column

3. For the automation with a return, i changed the trigger to "on update" with a condition that "trigger" column  is not equal before after.

The essense of this work around is that 1 scheduled bot triggers and cascades to multiple bot targeting the each specific row with a row level return.

Hope this can help.

View solution in original post

7 REPLIES 7
Top Labels in this Space