Add Row to Different Table

Hello,
Im trying to record the information of selected items or submitted forms into its own table.

On a view details screen pulling from table A, I have a button which when pressed I want the action to be - Add Row, but to a different table, table B.

Is this possible?

The linked table initially sets the add row details to table A column names, then when I change the destination table to Table B, all the options below where you link to what column you want the data entered into clears and turns to the word Custom. So from here I am getting confused as to whether it can be done?

any help here would be much appreciated it as its the main thing blocking me.

The Add Row action can write to any table. When you select Table Byou will see the columns from that table. Then you need to choose the column values from Table A that will be written to Table B. Choose Table B as your destination and then set the the values you want to populate I to each column.

Thanks Jeff, I thought that was how it was suppose to work but when I select table B (in this instance Materials), all the values change to empty and just say Custom:

Then If I click into an option value to try link it to my table, nothing shows up in the list:

Are there any columns in your Materials table?
Can you share a screen shot of that table?


this is the material table where I want the row created

Okay, so just going back to your earlier screen shot…

oh sorry I cropped that out the only thing there is the first Column on the table.
(ive changed the table layout and whatever is first in the table goes here)

Are you sure the Form is targeting the correct table?

That RowID value doesn’t correspond with your earlier screen shot :man_shrugging:

sorry let me rephrase that.

that one option showing at the bottom is pulling from the table of the details originally showing so my Table A. - and like I mentioned whatever is first in that table goes here.

So to clarify, I’m in a detail screen of Table A and want the button action to add a row to Table B.

oh yeah, sorry. That’s my bad - I asked the wrong question.

So presumably your first table contains more columns than just the RowID?
Would you mind sharing a screen shot of that one?

yep has about 5 columns of information.

Something isn’t right. What type of columns are they? Can you show me please?

yep, so this is table A (Toilet Types).

  • the temp QTY field is user specific I dont know if I need that it was just me trying to get the QTY the user enters to go somewhere but I really just need it on the Table B where I want the new row to be created.

-the user would select the toilet type from a list pulling from this Table A, then I’m trying to use a form or new screen to enter a QTY then place the toilet type and QTY required into Table B.

Okay, that’s really helpful. Now I understand what’s going on. I would suggest a slightly different approach.

Firstly, you can get rid of all those User Specific columns. You don’t need them. Set it up as follows:

  • Use an action to Show Form Screen
  • Target the form at your Materials table
  • Add a Choice component. Set the target as the Product Option column. Set the source table as the Fit Off Toilet Types table.
  • Add a Number Entry component. Target this at the QTY column
  • Add two special value components. One to capture the signed in users email address, and another to capture the current date/time. Target these at the appropriate columns in your materials table.

That should be all you need.

1 Like

Followed your steps and it worked! THANK YOU!

1 Like

a follow up question though, can the choice selector pull from different Tables other than always Table A.

so for example, when they click toilet this choice selector makes sense to pull from Toilet Types table, but if the next item down was selected so Bathtub - this has its own table of bathtub types. so the selector would now need to show bathtub types not toilet types.
So I guess I want to know how I can set an individual form setup for each item selected rather than one blanket form for all items in my list.
hope this makes sense…

Yes, you can do that.

A choice component can use any table as its source.
And then you can use screen value visibility conditions to hide/show the next choice component depending in the first selection.

However, in this case I would recommend refactoring your data. Instead of multiple tables, combine them all into a single “Items” table. This table would have a minimum of two columns:

  • Item Type
  • Item Option

If you set it up that way, it will be a lot easier to manage. All you would need is two choice components, no matter how many different Item Types you have.

The first one would be for Item Type, and the second for Item option. And you would use screen value filtering to narrow the options in the second one.

1 Like

I got this working from your information, and I understand how it’s setup, much appreciated!

1 Like