Add row to another table

Hello guys,

I need your help.

I have an app with table structures as shown in the attached image. I would like to know if it's possible to create a button that, when I input data into the 'assemblies estimate' table from the 'assemblies' table, it will automatically transfer related data from the 'required labor' table to the 'labor estimate' table and do the same for the 'required material' to the 'material estimate' table.

I know there is a function called "'add a new row to another table", but I'm confused about how to include the estimate ID when transferring data from related required labor and related required material of related assemblies to the 'labor estimate' and 'material estimate' tables.
Thank you so much for your help
Group table.drawio.png

 

 

0 4 157
4 REPLIES 4

You want to use the INPUT() function.  This was purpose built for passing values between actions - specifically refer to HERE.

I hope this helps!

Hello @WillowMobileSys thank you for the suggestion. Unfortunately, it has not worked yet. The estimate ID column in the sub-material estimate table is still blank. Do you have any other ideas? Thank you

Screenshot 2023-11-05 224251.pngScreenshot 2023-11-05 224345.png

Looking at your calling action - "syce_submaterial_estimate_from_assemblies", it doesn't appear that the INPUT() function is available to your app.  It is considered still in Beta and I have heard of others not having access to it.  This is evident since the action does not include an "ADD button under the "Referenced Action" area.

To confirm if this is truly the case for you,  refresh the Editor page and then return to this same action and see if the ADD button then appears.  I'm not certain if you also need to turn on the "Preview new features" button in the View General settings area.

If the INPUT() function still does not show,  then contact AppSheet support to see if they can make the INPUT() function available to your app.

As an alternative...

I am wondering if the "Assemblies Estimate" table is actually needed?  "Estimate" is really just a state of a work order.  In some systems, a work order is entered as an "Estimate" and once approved to continue, the state is simply flipped from "Estimate" to "Active" or some such state.

It seems that if an "Assemblies" row is attached to an Estimate, then it is automatically an estimate of the Assemblies object.  No need to have a separate table specifying it as an estimate. 

The point is that if you could remove the "Assemblies Estimate" table and just attach "Assemblies" directly, then you wouldn't have the need to transfer the Estimate ID to the "Assemblies" object through the "Assemblies Estimate" table.  This would also apply to Labor and Material.

I hope this helps!


@WillowMobileSys wrote:

it doesn't appear that the INPUT() function is available to your app


This is also the case with me. When an action is activated from another action, INPUT() works only when the action edits rows directly attached to the table (an action of type add a row to another table obviously is not the case...)  -- only the case described in the help doc.

Top Labels in this Space