Add row to another table overwriting

I have the following tables:

Customers - Columns: Name, Position

Engines - Columns: Position, Make, Model, Serial#, Date

There are up to four possible positions, each with their own make, model, serial # and date.

I would like to show the input boxes for these when adding a new Customer.  So on the Add Customer form.

I have set up enum list of the 4 positions in Customer column.  I have them as buttons on the form.

How can I allow the user to add one or more positions and related Engines columns to the add customer form?  I have tried using the action to add rows to Engines table on Customer add/update but it overwrites the those columns with new position entries when I save.

I guess I could add 12 more columns to the Customer table but would rather create another table that can be updated from the Customer form.

 

 

0 3 242
3 REPLIES 3

I don't follow what you're trying to accomplish. The following may help.

  • If you haven't already, you likely should create References between tables--e.g., in the Customers table set the Position column's data type to Ref and complete the other column properties to connect it to the Engines table's Position column.
  • Consider using the EnumList data type, which allows the user to select multiple values to store as a list in a single column for a record. For example, in the Customers table you could set the Position column's data type to EnumList and the base type to Ref, and connect it to the Engines table's Position column.

Steve
Platinum 4
Platinum 4

Sounds like you don't have your key column set properly.

What is a key? - AppSheet Help

 

Steve was right, I did not have the key column set correctly.  This is working as expected now.

For the ref columns in Customer table Form view:

If user selects "P" from dropdown menu (EnumList), below that menu I want to show ref columns/values (Make, Model, Serial, Date) from Engines table based on dropdown selection and current Customer ID.  Because I also want these shown columns editable, here's what I tried for initial value of one of those ref columns "Make" :

ANY(SELECT(Engines[Make],AND(Engines[Customer ID]=[_THISROW].[Customer ID], Engines[Position]=[_THISROW].[Engine Position])))

I get error below.  I'm not sure how to show these columns with their values(if they exist in table) and also make them editable.AIFL_2-1657386058157.png

AIFL_0-1657379194693.png

AIFL_1-1657385545971.png

 

 

 

 

 

 

 

 

 

 

 

 

Top Labels in this Space