Passing values to a form from a grandparent record

I have asked this question before but I think my understanding of appsheet has improved enough for me to better explain my question.

I have a I have a table called โ€œSessionsโ€ that has the following columns
Session ID (Key for this record)
Client (Client id for this session)
Assigned Objectives (Virtual column listing all of the assigned objectives for this client from a table called โ€œAssigned Objectivesโ€)

โ€œAssigned Objectivesโ€ has a behavior that opens a new form for a record in the table โ€œObjective Utilizationsโ€ filling in data from the โ€œAssigned Objectivesโ€

Selecting one of the rows in โ€œAssigned Objectivesโ€ opens a form and enters the data for a new โ€œObjective Utilizationsโ€ record.

I would like to also pass the โ€œSession IDโ€

In PDF Templates you can do something similar with a [_ThisRow-1] to access a grandparent record.

But that ([_ThisRow-1].[Session ID]) does not work with the expressions I enter for the behavior.

Is there a way to access this grandparent value in the expression for the bahavior?

I already have a quasi solution that I use at present (Detailed below) but it I think there must be a more elegant way to accomplish this.

Current solution

A behavior when the session is opened that sets a status column in the current record column to true after setting any other trues to false.

Then the โ€œAssigned Objectivesโ€ behavior sets the โ€œSessionโ€ column in โ€œObjective Utilizationsโ€ to the value returned by doing a lookup for the row in โ€œSessionsโ€ that has true set as its status. But this adds two extra sync actions.

0 4 758
4 REPLIES 4

Hi @Mark_Taylor ,

It sounds that you are trying to build a relation between grandchild and grandparent record to pull in some values from the grandparent record.

You may wish to take a look at the following article and especially the section " Double Dereference Expressions"

If you are looking for something else, I request you to post which is grandparent, parent and child table in your case and respective columns so that I believe the community may be able to help better.

I have used that article to accomplish other actions elsewhere in my app.

I donโ€™t think it will work in this situation unless I can put a virtual column in the Objective Assignment that somehow references the session record that is displaying it.

GrandParent = Session (with a Client Column)
Parent = Objective Assignment (reference to the Client Column)
Child = Objective Utilization

Yes, inclusion of a VCs is necessary in the approach described or the approach that I know of.

Sorry, I may not be able to add further. I believe , someone else may share inputs.

Hi @Mark_Taylor Iโ€™m also looking for the possibility to access the grandparent value via [_THISROW-1].[Grantparent_ID].
But as @Steve mentioned here, itโ€™s not possible.

Top Labels in this Space