I’m trying to develop a more elegant way to load a record into a placeholder by the “linked record” field in another table. If no one has any other suggestions, I’ll re-post in Product Suggestions.
The first way I have discovered to do this is using an expression, because the “linked record” fields are treated as a string (according to the error message in the expression editor, although I think it may be a text array.)
I initially tried to load the record by table record, but the linked record field was not an option because it is not a text field. So I used an expression TOTEXT(@table record.table_1.Link to 2) and the text generated was [“2-1”] instead of just 2-1, so I had to use 2 trim functions to remove the open and close brackets.
Has anyone found a better way, or is there a “Linked Record” → “Load Linked Record” option I am missing?
Thats a great call. I think our linked record documentation in general is lacking. There is a bunch of work going on in the next 6 weeks to revamp a lot of our documentation, and I will make sure this is addressed.
I’m now trying to do the same thing, but here’s what I find weird - maybe you can explain.
Stations table:
ID
Location, which is a MANY TO ONE linked field to the Locations table
(One record from table Locations can link to many records from the table Stations)
other stuff
Locations table:
ID
Stations, which is a ONE TO MANY linked field back to the Stations table
(Many records from the table Stations can link to one record from the table Locations)
other stuff
In the App, I load the current Station record into a placeholder (let’s call it “spr”) using ID=[App Info].[Station Name] which works fine.
Now I want to load the linked Location record (the whole record, not just the ID field). But I can’t do that based on the Station placeholder (spr). Why? It looks like [spr].[Location] (the linked field) actually contains an Array rather than a .
It doesn’t seem like it should be an array, because the relationship is many-to-one so there can only be a link to one record.
A workaround for this is to use two different variables:
One to store the [Stations].[Locations] which is an Arary
One to store the first item in that list by using an Array index function
Seems weird. Seems like it should realize that the linked field only allows one linked Location and return a String not an Array.