Update Table from Another Table

I have two data sources in my app sheet Table 1 is the primary data source with all the customer records and Table 2 has the history for the customers orders. When the status (its a ENUM in both tables) is changed for the customers order in Table 2 I want that to update the same status in Table 1. I tried following this solution but the Task option for updating looks to no longer be there.

2023-12-20 21_17_59-Test App - AppSheet.png

 

I have the following actions setup but they are not working:

Referenced Rows: SELECT(Table 2[Status],[Status]=[_THISROW].[Status])

2023-12-20 21_16_00-Test App - AppSheet.png

 Set These Columns: INPUT('Status',[Status])

2023-12-20 21_16_57-Test App - AppSheet.png

 

 

0 6 265
6 REPLIES 6


@googlenoob62 wrote:

When the status (its a ENUM in both tables) is changed for the customers order in Table 2 I want that to update the same status in Table 1.


 

Hey man,

that makes little to no sense, since there are multiple orders in possibly different states. It's a one to many relationship.

It's not a one to many. When the form is submitted to change the status in Table 2 it should update the same status in Table 1.

Sorry man,

ONE customer can have MANY Orders, even if it ain't so as you say LMAO๐Ÿ˜„

Referenced Rows needs to point to the key column in the referenced table. Your select statement for referenced rows does not select rows in another table, but rather statuses. It should be more like this:

SELECT(Table 2[key column], FILTER)

But like the other individual pointed out, something still does not quiet seem right from a relationship perspective. Also, your explanation is saying you want to update the status in table 1 when the record in table 2 is updated, yet the action you are setting up is actually reversed. Your current action would change all statuses in table 2 when the record in table 1 is updated.

Your 'Referenced Rows' Expression should always return a list of primary key values for the table you intend to update. My guess from your first screenshot is that you should actually be referencing the [customer record] column.

Landan_QREW_0-1703189412330.png

Try to change the expression to SELECT(Table 2[customer record (or whatever your primary key is)],[customer record]=[_THISROW].[customer record])

 

I think you're pretty much there, but you need to pass your [Customer Number] or whatever is the key field that joins your two tables together in the Referenced Rows section.

Something like LIST([CustomerNumber])

Top Labels in this Space