validif in yes/no column type

Hi everyone,
I have a column of type yes/no, where I would like the value “yes” to be selectable only under certain conditions.

this is the expression i created and the formula editor says the expression is correct

if(
   isnotblank(
         select(FORMATO_PRODOTTI[IDPRODOTTO],
                and(
                     [IDPRODOTTO]=[_THISROW].[IDPRODOTTO],
                     [TIPOLOGIA]=[_THISROW].[TIPOLOGIA],
                     [PREDEFINITO]="yes"
                   )
                )
              ),
"no",true
)

Unfortunately, when I save, I get the error:

Column Name ‘PREDEFINITO’ in Schema ‘FORMATO_PRODOTTI_Schema’ of Column Type ‘Yes/No’ has an invalid data validation constraint ‘=if(isnotblank(select(FORMATO_PRODOTTI[IDPRODOTTO], and( [IDPRODOTTO]=[_THISROW].[IDPRODOTTO], [TIPOLOGIA]=[_THISROW].[TIPOLOGIA], [PREDEFINITO]=“yes”))), “no”,true )’.

I came to doubt that the type of column does not allow to create this type of condition.

Or I’m doing something wrong.

Any suggestions?

Remove the IF function.

1 Like

tx for your help, maybe i’m tired lol

i solved with this:

if( 
   isnotblank( 
         select(FORMATO_PRODOTTI[IDPRODOTTO], 
                and( 
                     [IDPRODOTTO]=[_THISROW].[IDPRODOTTO], 
                     [TIPOLOGIA]=[_THISROW].[TIPOLOGIA], 
                     [PREDEFINITO]="yes" 
                   ) 
                ) 
              ), 
LIST("no "), LIST("yes","no") 
)
1 Like