Workaround for "Data change actions that are invoked by bots do not trigger other AppSheet bots."

hi, I’m struggling with finding a workaround for a limitation explained at: Bots: The Essentials | AppSheet Help Center
saying:
“Data change actions that are invoked by bots do not trigger other AppSheet bots. For example, if a client device performs an add, update, or delete that triggers a bot, and that bot invokes a data-change action, that data change action will not invoke any bots.”

In short I have a situation where:

  1. external app make a call using REST API which create an Order (parent) with Destinations (child) objects. Single Order can have multiple Destinations
  2. when status of one of Destinations is changed, it triggers a bot that changes Order (parent) status appropriately
  3. when status of Order is changed, I wanted to call another bot to trigger REST API call to external app

Right now I cannot find a workaround allowing me to do point 3. job. Scheduling is not an option, because action from point 3 should happen several times per day. I was thinking about an external system like Zapier or MS Flow calling an action on Order, but that’s also not a good option due to timing limitations - I need this action to happen as soon as possible (in seconds) after data change in action 2 happens.

Can anyone please support how this could be achieved?

Regards,
Jarek

What activity changes the status of the Order? User change? AppSheet Automation?

If it’s something within AppSheet, then you can mostly likely simply tack on an additional action that calls the API - no bot required.

1 Like

Sorry, I just re-read your post. It’s Automation that is changing the status.

In Step 2, create a Grouped Action. First action in group changes Order Status. Second action calls the REST API.

If you also allow for users to change Order status manually, then you can attach the second action to the Form Saved behavior so that the REST API is also called in this scenario - of course, if necessary!

Would this feature help you out ?

I updated the documentation as well.

1 Like

@Dan_Bahir and @WillowMobileSystems more clarifications from my side:

step 2. is a bit complicated since I use the following approach to update Order (parent) update based on Destinations (child objects), take a look:

After creating an Order (described in step 1 of my previous post) we have, the following situation:
Order #1 - NotStarted

  • Destination #1 - NotStarted
  • Destination #2 - NotStarted

User can manage Destinations statuses, any of such updates should trigger Order’s update.
User firstly need to start Destination, then finish it. This is done using two actions - ‘Start’ and ‘Stop’ that are visible on Destination Details card. When user click on ‘Start’ we should have the following situation:
Order #1 - InProgress

  • Destination #1 - InProgress
  • Destination #2 - NotStarted

Above update of Order status is done in few steps:

  1. Bot triggered when a Destination record is updated and the following condition is met:
    [_THISROW_BEFORE].[Status]<> [_THISROW_AFTER].[Status]

  2. This bot triggers a process ‘Run a data action’ → ‘Update Order Status - trigger when Destinations statuses change’:

  3. mentioned action is set to ‘Run action on rows’ which are referenced by LIST([Order]) in referenced action ‘Update Order Status to Completed’ that runs some logic to set appropriate status. (two remarks here - don’t be mislead by action naming → it’s updating Order to an appropriate state, not only ‘Completed’ :wink: , also Order = Job on my screenshot)

What I’m trying to achieve?
Any update of Order status should trigger a webhook to external app.

What stage am I?
I have created another bot that is triggered when an Order record is updated and the following condition is met (example for InProgress state):
AND( [_THISROW_BEFORE].[Status]<> [_THISROW_AFTER].[Status], [_THISROW_AFTER].[Status]=“InProgress”)

It turns out that bot is not being triggered because data change is caused by above described flow.

=====================
@WillowMobileSystems I’m still trying to use your suggestion, but actually I’m still facing the same issue that my final bot that should call REST API to external app is not being triggered :frowning: