Adding further conditions to dropdown list that is a already subset of a table

I have a number of dropdown lists in my app for people to be able to chose items from static lists.

To improve performance, I put them all in one table which has a column specifying which dropdown list each item belongs to. So the reference columns pointing to the table with the dropdowns each has a valid_if conditions like:

SELECT(dropdownTable[id], [listType] = “reports”)

This works just fine.

What I would now like to do is to add further checks to these dropdown columns. An example would be that a certain report or type of email can not be generated unless certain data has been provided.

So I would like to add a condition like:

if(
AND(
[_THIS]=“report1”, //The user is choosing to generate report1
[status]<>"ready), // But the status of this record is not ready
FALSE(),
TRUE()
)

So if a user selects report1 before column status is equal to “ready”, an error message is shown.

What I can’t figure out is if it is possible to add an expressions returning a yes/no to the select statement (which returns a list) I need to get the rights part of the dropdown table.

Has anyone managed to do this?

0 3 125
3 REPLIES 3

Perhaps this:

SELECT(
  dropdownTable[id] ,
  AND(
    [_THISROW].[status] = "ready" ,
    [listType] = "reports"
  )
)

This way, the dropdown will be empty until [status] is set to “ready”.

Valid_if can accept Yes/No OR a List data type, but not both from the same expression.

Thanks,

That will stop the user from being able to select the option that doesn’t work.

What I wanted to do was to allow the user to select it and then get an error message that tells them what they need to do to be able to select the option.

If the argument has to be either a list or a boolean expression, guess it can’t be done.

What i have done as a workaround is to set the valid if on another column using the value from the dropdown. Not super elegant but it works.

You could move the List-returning expression to Suggested Values, and have a Yes/No returning expression in the valid_if. That might work how you’re wanting.

Top Labels in this Space