We all know the power of references inside an AppSheet app, but there’s also some overhead associated with them; and by that I’m talking about:
- These are the
[Related Whatever]virtual columns that appear when you create a reference connection between two tables.
These are great, essential even, allowing you to now only view your data in a clear way, but also customize the functionality around your app as well. But sometimes you don’t need the reverse reference list - you just need to be able to pull some data from the reference.
How we dealt with this in the past
To help compensate for these “extra” reverse reference lists, many years ago AppSheet put a “hack” of sorts into the system; where if you:
- Left the name of the column the same (ie. you didn’t rename the virtual column); and
- Changed the app formula from the system-generated (
REF_ROWS("Table", "Ref_Column")) to
If these two criteria were met, then AppSheet would leave that virtual column alone.
- And a
LIST("")formula processes extremely fast.
Enter: Enum/EnumList (Base Type: REF)
In July, AppSheet announced the ability to take an Enum column with it’s base type set to REF, and use it the same way you might a reference column when pulling data.
This means that you can de-reference (and list de-reference) information from your Enum/EnumList columns the same way as you would a reference column or [Related Whatevers] virtual column.
Pulling a Single Value
[Reference_Column].[Column_I_Want_Data_From] <<<Reference column used to de-reference
[Enum_Ref_Column].[Column_I_Want_Data_From] <<<Enum column used to de-reference
Both function the same way, pulling a single value from the referenced table.
Pulling a List of Values
Both function the same way; creating a list of values from the referenced table.
I’ve put together a simple sample app showing how to accomplish both, if you want to see it in action: