Using SELECT() & REF_ROWS() in VCs


I have a table of Vehicles with a “VEH_UID” key & another table named "VehicleColors’ which holds references and extra details to the vehicles table. The VehicleColors table also contains a “Color” column which is an Enum of Refs with three possible values “RED”,“BLACK” & “WHITE”.

Now, in the Vehicles table i have a VC (“Related VehicleColors”) that holds a list of all the Refs made from the VehicleColors table to each Vehicle. What i want to achieve is to create another VC which will only hold refs from the VehicleColors table that contain only a certain color. I thought of using the “Related VehicleColors” VC and then use SELECT() to filter it using a condition. For example, i want this new VC to hold VehicleColors refs of the “RED” color. So here’s what i thought but isn’t working:

Related VehicleColors formula is : REF_ROWS(“VehicleColors”, “VEH_COL_UID”)
Expression i came up with for RED_VehicleColors : SELECT([Related VehicleColors] , [Color] = “RED”) but i get an error saying that it’s unable to find the Color column.

What am i missing here?

P.S. I’m completely new to Appsheet & SQL like queries so please bare with me :slight_smile:

1 Like
1 Like

Please post screenshots of the column lists (from Data >> Columns in the app editor) for the involved tables.