IN() function not working as expected

Hi everyone.

I'm having troubles with the IN() function, since is not working as it should be with the syntax

 

IN([Proyecto_solicitud],SELECT(PERSONAL[Proyectos permitidos_personal],[CorreoApp_personal]=USEREMAIL()))

 

[Proyecto_solicitud] is a ref type column from a table called Proyectos.

[Proyectos permitidos_personal] is an enum list with a basetype of ref also from the table Proyectos.

I want to use this formula to let the user see only the values that are in the allowed list of proyects in their respective [Proyectos permitidos_personal].

But, when i tested the formula, this occours.

G0ldsoul_0-1721149693991.png

I don't see what I'm  doing wrong here, since I've used this function many times in the past.

Thank you for your help

Solved Solved
0 8 342
1 ACCEPTED SOLUTION

What is the error message? Or do you mean the result is just wrong? When using CONTAINS, the longer string needs to be the first element like this in your case..

CONTAINS(CONCATENATE(SELECT(PERSONAL[Proyectos permitidos_personal],[CorreoApp_personal]=USEREMAIL())),[Proyecto_solicitud])

View solution in original post

8 REPLIES 8

since IN() is not a complex function. it may not go wrong . 

for me also IN() function shows false when it is tested in expression assistant  better ignore it check practically. there may be some other issue.

 

It won't work because your SELECT() generates a list of lists. You need to wrap the SELECT() with CONCATENATE() and then use CONTAINS() instead of IN() 

I tried this, but it didn't work, got the same error.

CONTAINS([Proyecto_solicitud],CONCATENATE(SELECT(PERSONAL[Proyectos permitidos_personal],[CorreoApp_personal]=USEREMAIL())))

G0ldsoul_1-1721168935277.png

 

 

What is the error message? Or do you mean the result is just wrong? When using CONTAINS, the longer string needs to be the first element like this in your case..

CONTAINS(CONCATENATE(SELECT(PERSONAL[Proyectos permitidos_personal],[CorreoApp_personal]=USEREMAIL())),[Proyecto_solicitud])

Yes I meant the resualt wasn't what i expected because I was witting the CONTAINS() syntax wrong, thank you very much!! 

You're welcome!


@AleksiAlkio wrote:

It won't work because your SELECT() generates a list of lists. You need to wrap the SELECT() with CONCATENATE() and then use CONTAINS() instead of IN() 


Also I didn't undertood at first the "list of lists" but my fisrts expresion worked, when the select was wrapped with ANY() to take only one value of the first list, thank you too for that explanation.

You're welcome!

Top Labels in this Space