Updating values in a table different from the one that triggered an automation event

Hello There!

I have a table Users (fields: userid, firstname, choresOrder)

I have another table Chores (fields: userid, chore)

I have written an Apps Script that takes the list of chores for a given user and comes up with an order for a user to do those chores in (in the most efficient way possible).  

The Apps Script works fine and returns the chores order fine, but I'm having trouble taking the chores order (LongText) and updating my Users.chores_order field with it.

I have tried referencing an action in a data update action right after the script task by passing the values received in the return value; I choose the 'run actions on row' approach to call the Users action I've created but I can't seem to figure out how to pass in the return value from my automation to it.

I can confirm that all works fine when I simply update a value in the Chores table right after the script runs ... just when i 'run actions on row' in the external Users table does it all fail.

Any advice/help would be greatly appreciated! thank you!

Solved Solved
0 6 173
1 ACCEPTED SOLUTION

6 REPLIES 6

I think you'll want to use the INPUT() function.  This allows for passing of values between actions

Refer to this article for more details:  Set input values dynamically in data-change actions 

NOTE:  There are two implemented version of the INPUT() function.  The one above is the latest but if you refer to other article you may find them describing things in a different format.

I hope this helps!

Thanks WillowMobileSys.

I have actually tried the INPUT method.  But the [Apps Script Function].[object key] field does not pass through to the linked Action I have defined.  

What I am going to look at doing as a workaround is reverse things around and have the Chores table update the User table any time a new chore is added.  Then I'll create an automation event triggered by the User table to call my Apps Script and then update the table directly once the return values come back.

Also, just adding that the advanced > INPUT section only shows up for "Set row values" option and not "Run action on rows" option in automation.

I'm looking for "Run action on rows" to reference an action that will update a different table.

I have now created an automation bot that updates the appropriate user table when the chore table receives a change.  this works fine.

however, the update to the user table does not trigger my second automation bot now.  im assuming for some reason the data change event which triggers an automation has to be a user-driven event and not another automation bot trigger the change?

Enable this:

Steve_0-1725393177634.png

Thank you so much Steve!  This did the trick!  Sorry I missed it!!

Top Labels in this Space