Force an app to sync after DB changes from another app

I have two separate AppSheet apps that reference the same Google Sheet. When App A makes changes to the shared sheet, those changes don't get reflected in App B until App B does some other operation on that sheet (at which point Quick sync seems to pick them up), or App B does an explicit sync, or the usual 30 minutes or so have passed.

I'd like those changes to be reflected in App B sooner, regardless of usage of App B. Is there any way to force App B to recognize there are changes in the Google Sheet and either Quick sync or full sync?

I did find this thread, which implies you can create a bot that uses a web hook and API call to from App A to App B and cause App B to realize there are changes and sync, if I'm understanding it correctly, but it's not clear to me how to actually implement it. I tried creating a bot in App A, triggered on Data Change, and sent the request to App B, but I don't know if that's what I'm supposed to do, or if so what to put in the request body (I don't actually want to change a row, or even know which row just got added). Am I on the right track, if it's possible at all? Thanks.

appbot.jpg

(BTW, I only have AppSheet Core. Webhooks work with Core, right? It's only external access via the API that you need Enterprise for?)

Solved Solved
0 2 433
1 ACCEPTED SOLUTION

Bad form to reply so much to my own topic maybe, but I found the answer: A search finally turned up this thread where the problem was a bad time zone... that was my problem as well (there is no "Mountain Standard Time", only "US Mountain Standard Time" and "Mountain Standard Time (Mexico)")... sigh, I had issues already with ambiguity from AppSheet inventing their own time zone specifications, but I digress...).

Once I fixed the time zone in the JSON properties, the changes took effect in the other app.

Then I realized that I could just use the automation webhook to edit everything I needed in the row, rather than how I was doing it with an action that fired after the form was saved. By making the edit via the webhook in App A, App B realized the data had been updated and did a Quick sync all on its own. Problem solved!

View solution in original post

2 REPLIES 2

An update on what I've tried. Just to see if it would work, I had the bot in App A fire on data change, and send an Edit request to App B (change the "NOTES" column):

{
"Action": "Edit",
"Properties": {
"Locale": "en-US",
"Timezone": "Mountain Standard Time"
},
"Rows": [
{"UID": "<<_PSUID>>",
"NOTES": "Foo"}
]
}

The bot is sending the POST to the correct app (App B), and the bot monitor seems to show success--I see the return value with the updated NOTES field (set to "Foo", was blank previously):

{"Response":"{\"Rows\": [{\"_RowNumber\":\"4\",\"DATE\":\"08/18/2024\",\"NAME\":\"redacted\",\"TIME IN\":\"10:42:00\",\"TIME OUT\":\"\",\"INITIALS\":\"\",\"CHECKED IN\":\"In\",\"ABSENT\":\"\",\"NOTES\":\"Foo\",\"AFTERCARE\":\"Yes\",\"HOT LUNCH\":\"No\",\"MOVED TO AFTERCARE\":\"\",\"UID\":\"9fd0f6aa\",\"_Currrent Time\":\"10:54:42\",\"_PICTURE\":\"ReadOnly Student List::Student Pics/redacted.jpg\",\"_Show No AC Today\":\"\",\"_Show No Hot Lunch Today\":\"\",\"_Show Sign In Note\":\"\"}] }"

However, when I look at the actual spreadsheet, the value of the NOTES column hasn't changed.

My thought was to add a timestamp column that could be edited on a data change and trigger the data to sync, but I'm not able to get the bot to actually edit the sheet so I must still be missing something.

Bad form to reply so much to my own topic maybe, but I found the answer: A search finally turned up this thread where the problem was a bad time zone... that was my problem as well (there is no "Mountain Standard Time", only "US Mountain Standard Time" and "Mountain Standard Time (Mexico)")... sigh, I had issues already with ambiguity from AppSheet inventing their own time zone specifications, but I digress...).

Once I fixed the time zone in the JSON properties, the changes took effect in the other app.

Then I realized that I could just use the automation webhook to edit everything I needed in the row, rather than how I was doing it with an action that fired after the form was saved. By making the edit via the webhook in App A, App B realized the data had been updated and did a Quick sync all on its own. Problem solved!

Top Labels in this Space