Status Indicator based on if value is found in another query

I have a table where users can enter specific values into the field. I would like to have a status indicator appear when the data a user has entered does not belong in a set list of values.

In the status indicator 'Show when' field, I want to do something like
!{{ query1.data.column.map(row => row.column).includes(item) }}, but that isn't working correctly. Does anyone have suggestions on what to do for this?

Thanks so much,

Have you considered setting the field as tag or multi-tag and restricting the values that the user can select that way? You can manually create the list or map it to a data source.

I considered it, but that method ends up being a little too slow for users doing their data entry.

For some more context, I'm trying to build is an app that allows them to upload a CSV and do a quick data validation in a table that populates. In that table, I want to highlight values for them that won't pass the validation in our system.

You can definitely do a color coded validation for values in cells:


(HT to @Tess here)

But it won't recognize the value you enter until you save it, and won't give an indicator that the value you are typing is right or wrong...

Quick and dirty that I can come up with is accessing the changesetArray for the table and throwing up some sort of big nasty error once you navigate out of the cell:


(maybe you can script something nicer :thinking:)

Code for coloring cells:
{{ (((query1.data).includes(item)) ? "green" : "red") }}

Code for big nasty error :
{{ table1.changesetArray.some(obj => obj.hasOwnProperty('role') && obj.role === 'foo') ? "# Don't put that there!" : "move along" }}
(you can incorporate the .includes() concept from above to reference the "valid_list" and you could incorporate the value of the row from the changesetArray to give more information about what is wrong...)

3 Likes