Hi @Brendon
1. A Form is equivalent to a Table in common database language. Within each Form there are Fields that comprise the types of data you want to capture (think of different columns in a spreadsheet). And each Form can have as many Records as you like to store the information in the fields.
That makes sense. Thanks
2. Your screenshot doesn’t show the parent form, so I don’t know how you have it setup. But you can’t really display a single field or value from a Many to Many relationship. That’s because with a Many to Many relationship, there can be many fields and many rows in that relationship. Tap Forms does allow you to generate aggregate calculations for Number fields from a formula though.
I’ve attached updated parent and child forms and the Record ID field (previously called File Name) calculation.
The child form, Counterparties shows two records (Coles and Energy), but on the parent form in the one record I have selected one record from Counterparties (Energy).
Perhaps I could elaborate on what I am trying to do and compare this to how it works in AirTable which might help to establish if and how (or if not) this can be achieved in TFP?…
My objective is to maintain a child form (Counterparties form) with many fields pertaining to counterparties. On the parent form (Documents), one of the things I want to show for each relevant record is a selected counterparty name from the child form (the option exists to show more that one per parent form record, but in this case I just need one). I also want to show for that parent record two other fields from the child form that pertain to that particular counterparty, but I don’t want to see all of the many fields from the child form repeated in the parent form.
In AirTable in the parent form (Documents) in a new field (Counterparty) I would link to another form, by selecting that form in a dropdown. I could then select a record in this new field in the parent form, and a dropdown in that field would allow me to link to a particular record in the child form. The record ID selected in the child form would then appear in the field in the parent form. The record ID comes from the left-most field in a form, in this case the child form.
This appears to be similar to what I have achieved in TPF in the table appearing to the right of the Counterparty field in the single column view in the parent form (in this case I selected Energy).
In AirTable, I can then create new fields in the parent form to show other fields from the child form (AT calls them a Lookup); in this case I want two more. So in total there would be three fields in the parent form drawing from the child form: the link to the record ID (Counterparty) and two others (say, Address and Phone No.), but in this case I don’t want to see Counterparty Logo and so I don’t select that one.
I then want to create a left-most ID field (Record ID) in the parent form that concatenates certain fields in that form, in this case Counterparty (which would ideally be the Counterparty Name from the child form) and Legal Briefs (the latter being a text field in the parent form). Note that I am trying to do that using the Calculation function (but perhaps that is wrong).
Attempting to do this in TFP, I see in the parent form that the Counterparty field is linked to the Counterparties forming a many to many relationship with inverse relationships shown. In the multi-column view at the top nothing is shown (which surprises me). In the single-column view underneath in Counterparty field there is a a table which shows two of the four fields in the Counterparties child form. I’m not sure why two of four only appear, but I really need only one for my use case: Counterparty Name and I have successfully selected one record: Energy (but as noted it doesn’t appear at the top under the Counterparty field (?)).
After trying my formula (“calculation”) and the recommendation from @Chris Richardson I cannot get anything to appear in the Record ID. What I want to show is [Counterparty]-[Legal Briefs], for example the second record might show the same counterparty with a legal brief no. 2.
So I am stuck on this as well.
If you need more advanced access to the rows and fields in a Link to Form field setup as a Many to Many relationship, then you’ll need to use JavaScript with a Script Field or Form Script that lets you loop over the records of the relationship and pick out the data that you want to display on the parent form.
Ok. If that is the only way to achieve what I am after then I would investigate that. I’d appreciate confirmation or otherwise that based on my long explanation above, that scripting is the only way before embarking on that (and considering whether it is a route I want to pursue given how easy it is in AT and scripting sounds like more work(?)).
Many thanks
Attachments:
You must be
logged in to view attached files.