Action: Passing an enum status value from parent to child

Hi.

What it the best way to pass an enum value from a parent record to a child record when building a simple action type: Data: set the values ofโ€ฆ ?

I thought this [Opรฉration ID].[Statut] would work since I have the REF to the parent (Opรฉration ID) on the child table but it indicates: Error in expressionโ€ฆ

This works but I do not feel it is the best way.
INDEX(SELECT(Opรฉrations[Statut],[Opรฉration ID]=[_THISROW].[Opรฉration ID]),1)

Solved Solved
0 10 708
1 ACCEPTED SOLUTION

The Opรฉration ID colum is of type โ€˜Textโ€™ instead of โ€˜Refโ€™. This is why de-referance fails and the select expression works

View solution in original post

10 REPLIES 10

Steve
Platinum 4
Platinum 4

In the Set these columns value expressions:

Bare column expressions refer to the row from which the action is initiated. For instance, if the action is performed from/by the parent row, [Statut] refers to the Statut column value of the parent row. Prefixing the column with [Opรฉration ID]. is unneeded and probably even problematicโ€“unless your intention is to dereference the Opรฉration ID column value of the parent row to get the Statut column value of a different row (which doesnโ€™t appear to be the case here).

I would expect the following expression to be all you need:

[Statut]

Hi @Steve.

Thanks for your input! To give more context, the action is initiated from the child called Affectation (which also has a Statut field ). So as you have explained [Statut] is the value of the current row, the child which is not the value expected.

To be more precise (by using your vocabulary which shows your deep understanding of the product), I am trying to dereference from the child to the parent.

It sounds like I am doing something wrong that prevent this dereference to work.


!

The Opรฉration ID colum is of type โ€˜Textโ€™ instead of โ€˜Refโ€™. This is why de-referance fails and the select expression works

Hi @Sid

Thanks for your sharp observation!

Hi @Sid

I have just came across this situation where the table column is set as a text value and the dereference works in the App formula but not in the Initial value. What explain this behaviour?

When the column is set as a REF, it works in both cases.

Thatโ€™s probably a bug. Whatever the case, if you intend to dereference it, it should be a Ref.

Hi @Steve.

I am sure you have a good intuition for detecting a bug.

Lets pretent that the dereference is a date, text, addressโ€ฆ Does it make sense that the receiving column be a REF?

In this expression:

[Evenement ID].[Saison ID]

The Evenement ID column must be of type Ref to function properly everywhere it should. The type of the Saison ID column has no bearing on the dereference of Evenement ID. The type of the Saison ID column should be compatible with that of the column being set (numeric if numeric, temporal if temporal, etc.).

Does that cover what youโ€™re asking?

Hi @Steve

You are absolutely right. Let me bring some clarification on the behaviour I have observed.

When the column to initialize is of TEXT type the dereference in the Initial value does not work. While if it is of REF type the initialization works.

In the scenario below, the field Saison ID is blank while a value is expected. Also, if Saison ID it a TEXT and the same expression is put in the Formula. The value will be as expected. So, it seem the dereference does not produce the same result depending of the receiving value type (TEXT or REF) and whether the Formula or Initial value is used.

Is there a logical explanation to it?

Againโ€ฆ

โ€ฆin AppSheet itself.

Contact support@appsheet.com for help with this.

Top Labels in this Space