Pass data between views

If I have a Form from a table with a reference to another table, that field is shown as a dropdown, when I click it the option to add a new record to that table appears. Do I have a way to pass the ref of the id of the table of the form, to initialize the fields of the second table?

0 1 183
1 REPLY 1

Let me make sure I understand your setup here. You are on the child record's form and use the new button in the ref field's UX to create a new parent record. And what you desire to happen is for one or more fields on the parent record to calculate their values according to the values found in fields from the child(ren) records that have the Id of this parent in their ref fields?

If my understanding is correct, then the parent record should have an auto-created virtual column called Related CHILD TABLE NAME, which is a list/array of values. Depending on what you are trying to calculate, it would be something along the lines of:

SUM([Related Children][NumberField])

Alternatively, and probably more 'traditionally', you can have the second table in this scenario actually be the child table. In the settings of the Ref field on the child table that 'points' to the parent table (the first form record), check the box for "is a part of", then directly within the form of the parent record you can add child records before even saving the parent record. Behind the scenes, the id of the parent is automatically applied to any child records created in this manner.

Top Labels in this Space