Action Beetween Different Tables

Hi, I’m Italian and I have some difficulties in correctly understanding the function on AppSheet.

In my app I have 2 different tables. In the first one (I called it “AUTO”) is a list of records with all the details for each machine I have. In the second table (named “VENDITA”) I want to record any sales associated with the single car and customer (there is another table that contains all my customers). ok, simply. I would like…
when I create a new sale, I would like the value in the “Status” column (in the “AUTO” table) to change from (current status) to “Venduta” (SOLD in English). I’ve tried to do this by Automation, but this don’t help. Maybe i’ve just wrong somethings. It seems that i can’t do more actions througt diffrent tables. I don’t know. can you help me, please?

Solved Solved
0 3 105
1 ACCEPTED SOLUTION

Hi @Fred_Vanni ! Welcome to the Community!!
I would not recommend using automation. There is a better way.

Ok, first thing…make sure that in the VENDITA table you have a REF type column to the AUTO to indicate which car is being “Venduta”/sold.

In each Form view (in your case “VENDITA_Form” view), the Editor has a Behavior section which includes a “Form Saved” property to attach a custom action executed when the Form is Saved. You will want to attach a custom action (you’ll actually need 2) to update the car record in the AUTO table.

To create your actions:

  1. Create an action on your AUTO table of the type “Data: set the values of some columns in this row”. Configure this action to set the “Status” column to “Venduta”

  2. Create a second action on your VENDITA table of the type “Data: execute an action on a set of rows”

    • Set the “Referenced Table” property to “AUTO”
    • Set the “Referenced Rows” property to LIST([Auto]) - the Auto column is a REF column but needs to be in a list
    • Set the “Reference Action” property to the action created in 1) above
  3. Attach the action fro 2) as the “Form Saved” action in the the Form view.

Now when you Save a VENDITA row, the action will automatically run to set the Status of AUTO row for that car to “Venduta”

I hope this helps!!!

View solution in original post

3 REPLIES 3

Hi @Fred_Vanni ! Welcome to the Community!!
I would not recommend using automation. There is a better way.

Ok, first thing…make sure that in the VENDITA table you have a REF type column to the AUTO to indicate which car is being “Venduta”/sold.

In each Form view (in your case “VENDITA_Form” view), the Editor has a Behavior section which includes a “Form Saved” property to attach a custom action executed when the Form is Saved. You will want to attach a custom action (you’ll actually need 2) to update the car record in the AUTO table.

To create your actions:

  1. Create an action on your AUTO table of the type “Data: set the values of some columns in this row”. Configure this action to set the “Status” column to “Venduta”

  2. Create a second action on your VENDITA table of the type “Data: execute an action on a set of rows”

    • Set the “Referenced Table” property to “AUTO”
    • Set the “Referenced Rows” property to LIST([Auto]) - the Auto column is a REF column but needs to be in a list
    • Set the “Reference Action” property to the action created in 1) above
  3. Attach the action fro 2) as the “Form Saved” action in the the Form view.

Now when you Save a VENDITA row, the action will automatically run to set the Status of AUTO row for that car to “Venduta”

I hope this helps!!!

Hi! Thank you for replying, very kind! I tried to do as you tell me. what you tell me is logically right. but in actual fact nothing happens. I think I did exactly what you told me. I just can’t figure out why. I have a doubt, is it right to use the “LIST [AUTO]” function?
PS I already had the referential column for cars sold (in the VENDUTA table). Should I also do the opposite? (Reference “VENDUTA” in the “AUTO” table)?

I’m sorry. I was wrong. I had assigned the last action to the “UX View” Wrong. I had assigned it to VENDITAA_Form but I had already marked the form on the menu view … so it didn’t work. Now it works perfectly! Thanks again so much for this help!

Top Labels in this Space