Input Function to Add Rows to Join Table

I know that the INPUT() function is still in beta mode, but could not find any posts or documentation that addresses using this functionality to add rows in a Join table.

Let's say I have three tables, TableA, TableB, and TableAB. I would like to add an action for TableA that lets me select multiple rows (i.e. bulk selection) and then brings up a popup (input) for allowing me to select a single record in TableB to then add the rows from TableA with the selection in TableB to TableAB. So the end goal being if I have 5 rows selected in TableA and the one selection in TableB it would result in 5 entries in TableAB.

Is INPUT() even the right way to get this accomplished or is there an alternate better solution?

Solved Solved
1 7 370
1 ACCEPTED SOLUTION

You can do this, and INPUT certainly helps one part, but it's not the primary actor. Something like:

  1. Create a flagging action on tableA, to run on all bulk-selected records, that sets a value to some column in order for those records to be identified later via expression.
  2. Create the INPUT() action on tableA to set the value to a column on a single tableA record, to choose the tableB record. You'd run this action only on a single tableA record, not from bulk-select.
  3. Set up a Bot, or a grouped action to generate the tableC records from each of the flagged tableA records, using the single selected tableB value. Either can be set to run automatically after #2.

You could easily replace the INPUT action with just sending the user to a form view to gather the tableB input.

View solution in original post

7 REPLIES 7

You can do this, and INPUT certainly helps one part, but it's not the primary actor. Something like:

  1. Create a flagging action on tableA, to run on all bulk-selected records, that sets a value to some column in order for those records to be identified later via expression.
  2. Create the INPUT() action on tableA to set the value to a column on a single tableA record, to choose the tableB record. You'd run this action only on a single tableA record, not from bulk-select.
  3. Set up a Bot, or a grouped action to generate the tableC records from each of the flagged tableA records, using the single selected tableB value. Either can be set to run automatically after #2.

You could easily replace the INPUT action with just sending the user to a form view to gather the tableB input.

Just to check, but I think that would require the addition of a column in TableA to store the value from TableB, and then set the INPUT() function on that column? Once the INPUT() value is set then run an action for the Change on TableA run an action that would add the records to TableAB?

Correct

I was afraid of that. This would be so much easier if Appsheet recognized many-to-many relationship endpoints as an enumlist input. Having to Add a column that essentially stores a list of relationships only to add those values to a bridge table is contrary to relational databases. But I digress. Thank you.

Solution accepted simply for the fact that it is a solution to handle the specific problem. I will likely try to come up with something alternative simply because Appsheet is lacking 'natural' integration of many-to-many relationship endpoints. I have only worked with two other 'no-code/low-code' app building tools, Google App Maker and Budibase, both of which had/have natural integration via multiselect inputs for the many-to-many relationship.

Hello, I just found your post now. I wonder if you have found a solution using the input function? If so please share the solution with me!

At the moment the process described by @Marc_Dillon is the solution. Unfortunately Appsheet does not currently recognize a many-to-many relationship end point by just a 'enumlist' (i.e. Multi-Select) without implementing some workarounds. If you actually have a SQL database with a bridge table then you do need to implement an extra physical column (not virtual column) in either Table A or B, and then implement another workaround (looping sequence of actions) since Appsheet also does not have a default looping function to write your records to Table AB.

Top Labels in this Space