Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Bot to make updates between tables

I have two tables where both have fields for customer id and status. The status in both tables is pulled from a ENUM Ref List.

When a record is added to Table 2 I would like for a Bot to take that status and update the same status for the customer id in Table 1.

I created a Bot to trigger on event type Data Change for Table 2 and only for adds. I then have a step that calls a Update Table 1 process set to Add | Status = [Status].[Status]

Bot_1.png

 Bot_2.png

The Update Table 1 process is set for Table 1 to run a data action to set the row values for the Status column

Bot_3.png

 

This is where I'm stuck as I don't know how to get the Status from Table 2 and update the Status in Table 1 for the same customer id

I get this error message when it does run: Error encountered in step with name [New step]: Error: Row having key '' in table 'Table_1' in field 'Customer Record' is required to have a value

 

Solved Solved
0 7 411
1 ACCEPTED SOLUTION

I understand. 

How about using AppSheet API?

You should first Enable the API. And then, select Run a task > Call a webhook.

chansol_0-1708045314306.png

Target Table Name will be Table 1.

And the request body will be like:

{
  "Action": "Edit",
  "Properties": {
    "Locale": "en-US",
    "Timezone": "Pacific Standard Time"
  },
  "Rows": [
    {
      "Customer ID": "<<[Customer ID]>>",
      "Status": "<<[Status]>>"
    }
  ]
}

 

And headers:

Authorization: "Bearer <<Your Access Key>>"

Content-Type: "application/json"

It will find the Table 1 data where Customer ID is the same to the new added data to Table 2. And then it will update the Status to the new value.

View solution in original post

7 REPLIES 7
Top Labels in this Space