Workflow triggering when changes are made to the database

Gnagno
Participant I

Hi all,
Is there a way, a bypass or something that would allow workflow triggering when changes are made to the database (spreadsheed) on the server?
Thanks in advance for your advice.

0 15 790
15 REPLIES 15

Steve
Participant V

Nope.

Gnagno
Participant I

Thanks Steve
your straight answer discourages me from using Appsheet which I instead find great.
If I can take advantage of your knowledge, how would you handle the need to create a mobile app which gets synchronized with the database and can trigger events (such as emailing alerts) either when something specific gets updated in the database or through the mobile app?
Thx in advance

I have no suggestions to offer. @LeventK, perhaps?

Just update and edit your data through Appsheet API so that Appsheet can detect the change in data to fire your own workflow.

Appsheet is business app, not designed for instance, chat app.

There should be technical difficulties for now to push the change in data base to โ€œclientsโ€ like Real-time database would do.

Firebase, Firestore, or any other availble โ€œrealtime databaseโ€ is not accsssible from Appsheet.

But again โ€œFOR NOWโ€

I just tested Amazon Honeycode.

They are based on their own โ€œworkbookโ€ which is something like Google spreasheet with least functionality. Good thing with it is it is realtime database.

I was not impressed by Honeycode at all, just because it was just like a slighly advanced web form builer although it stands on the realtime database.

For me, Appsheet is the world best tool to develop app in agile way.

@Gnagno
You can set a Google Apps Script in your back-end gSheet and bind it to an onEdit(e) trigger which will make UrlFetchApp call to a desired AppSheet API endpoint and update your app data which will also trigger any workflow set as UPDATES_ONLY or ADDS_AND_UPDATES. Thatโ€™s the only way to trigger an AppSheet workflow rule by editing the back-end manually.

Gnagno
Participant I

Guys you are masters thanks so much.
I do love Appsheet and the support you are giving. Thumbs up!

Hi LeventK,
Would you happen to have an example of the UrlFetchApp call to AppSheet API?
In my case, every time an existing record is updated in the server (Google sheet) Iโ€™d like the API to copy all records (not just the one that got updated) into the Appsheet table, and consequently trigger the workflow that I have set as Adds_and_Updates.
Thanks for your help.

@LeventK donโ€™t want to hassle you on this but Iโ€™m a newbie and would really benefit of your help with an example of the UrlFetchApp call described above.

@Gnagno
This is just an example. The code will differ depending on how and form which source you want to trigger it for execution

var appID = "Your_App_ID_Here";
var apiKey = "Your_AppSheet_API_Key_Here";
var tableName = "Targer_Table_Name_Here"

function uploadDataToAppSheet() {
  var baseURL = "https://api.appsheet.com/api/v1/apps/"+appID+"/tables/"+encodeURIComponent(tableName);
  
  var payload = {
    "Action": "Add",
    "Properties": {
		"Locale": "Your_Locale_Here",
		"Location": "Your_GPS_Coordinates_Here",
		"Timezone": "Your_Timezone_Here"
	},
    "Rows": [
      {
        //Your JSON Payload goes here
      }
      ]
  }
  
  var options = {
    'headers' : {
      'ApplicationAccessKey': apiKey,
      'content-type' : 'application/json'
    },
    'method': 'POST',
    'payload': JSON.stringify(payload),
    'muteHttpExceptions' : true
  };
  
  var response = UrlFetchApp.fetch(baseURL, options);
}

Hi,

How can we use this code for updating an existing record? Like how the code would know the exact row to update?

The โ€œevent objectโ€ (the โ€œeโ€ in onEdit(e),onChange(e),etc) contains the values of the row/cell/etc that was updated.

Thanks for replying. Help is highly appreciated!

I can get the row number from the Spreadsheet but I canโ€™t figure out how to find the exact row in the Appsheet table that needs to be updated.

Are you sending a webhook to Appsheet API for an Edit action? You just need to include the rowโ€™s key column & value in the payload.

https://www.google.com/search?q=appsheet+api

Ok. Thanks for the help!

Top Labels in this Space