Just checking..Is there yet a way to pull a single REF item from a list and dereference it?

Many times we have lists of REF items (such as for an EnumList/REF column). Occasionally, we want to pull an item from that list and access some of the other row attributes. Currently, we need to pull that item from the list and then use it for matching in a SELECT() function. For example:

ANY(SELECT(Table[Desired Attribute 1], [ID] = INDEX([REF Enum List], 1)))

ANY(SELECT(Table[Desired Attribute 2], [ID] = INDEX([REF Enum List], 1)))

ANY(SELECT(Table[Desired Attribute 3], [ID] = INDEX([REF Enum List], 1)))

It would be much nicer, and more efficient, if I could do something like:

INDEX([REF Enum List], 1).[Desired Attribute 1]
INDEX([REF Enum List], 1).[Desired Attribute 2]
INDEX([REF Enum List], 1).[Desired Attribute 3]

The use of the โ€œdotโ€ notation tells AppSheet I expect the item to be a REF and wish to dereference it. (PSST, this is not my idea, itโ€™s used this way already in C# and other programming languages).

I was wondering if there isnโ€™t already something like this available?

0 3 112
3 REPLIES 3

Steve
Platinum 4
Platinum 4

Unfortunately, not possible.

Although, this hypothetical example you offered:

INDEX([REF Enum List], 1).[Desired Attribute 1]

Can be achieved with this:

INDEX([REF Enum List][Desired Attribute 1], 1)

Thanks! I do forget about that syntax from time to time.

In this case, I am thinking more generally. It would be nice to be able to dereference any time the result is a single REF row - such as from MAXROW() or any other function that might return just a single REF value - especially now that we can deference multiple levels. Iโ€™ve had occasional use for such features. Iโ€™ll open a feature request.

Yes, if one is willing to add one additional column in the table, one could get rid of those SELECT() statements with a much shorter dereference expression.

The added column called say [SingleReference] can be a โ€œRefโ€ type column referencing the parent table with an app formula INDEX([REF Enum List], 1)

Then the other attributes could be found with
[SingleReference].[Desired Attribute 1]

[SingleReference].[Desired Attribute 2]

[SingleReference].[Desired Attribute 3]

Top Labels in this Space