Trigger workflow from menu/view (not from within table row)

Is there a way to create a view that is essentially only a button that triggers a workflow? (nb. so a button in the menu, not in any row detail view)

I’d like users to have a main menu item that triggers (via post request) an appsscripts in the gDrive sheet. ie. “refresh my data”. This appsscript will update the data in the gDrive sheet from a back end database.

nb. since the backend database is updated every minute, scheduling the appsscript (ie. daily) is not a usefull solution.

Solved Solved
0 5 442
1 ACCEPTED SOLUTION

@Derk-Jan_Woltjer
In some extent, yes it’s possible. However, the user needs to SYNC the app again to see refreshed data from the back-end provided your script is refreshing the data in the back-end.

To accomplish this:

  • Set a Menu/Home Menu table within your back-end and a DateTime column at the end of this table.
  • Set a Behavior Action for this Menu Table:
    • Do this > Data: set the values of some columns in this row
    • Set these columns > DateTime | NOW()
    • Prominence > Do not display
    • Only if this condition is true > [KeyColumnName] = “The_ID_of_Refresh_Data_Menu_Item”
  • Set a Deck View for your Menu/Home Menu.
  • For the Row selected property of this View, assign the above behavior action
  • Set a Webhook Workflow Rule which will work with UPDATES_ONLY

When the user clicks on the Deck View item i.e. Refresh My Data, it will initially trigger the action and record a NOW() value to the DateTime column of the table, and then the workflow rule will be triggered which will make HTTP POST request to your appscript code.

To achieve this; you need to wrap your original code inside a doPost(e) event and then deploy that code as webapp which should run as you and for anyone, even anonymous.

And maybe remind you again; provided your Google Apps Script is updating back-end data, the user SHALL EXPLICITLY SYNC the app to see any updated data.

View solution in original post

5 REPLIES 5
Top Labels in this Space