Unable to find a referenced column with an slice

Hi everyone,

I have this issue with finding a column in this formula:


i’m trying to do a security filter but this error appears, this are the tables wich are called:
Table Unidades

Table Proyectos (From wich ProyectosID is called)

Table usuarios
This is were the slice “users” is made

I don’t know why the formula doesn’t recognize the ProyectID column, i think everything is referenced as it should be.

Solved Solved
0 3 149
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

The users slice probably doesn’t include the ProyectosID column of the Usuarios table.

View solution in original post

3 REPLIES 3

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Oldsoul

That’s strange indeed, your expression looks fine to me.
But I better go with the data table directly, instead of slices.
You may want to try that instead:

OR(
  LOOKUP(USEREMAIL(),"Usuarios","UserID","ROL")= "Admin",
  AND(
    LOOKUP(USEREMAIL(),"Usuarios","UserID","ROL")= "Usuario",
    LOOKUP(USEREMAIL(),"Usuarios","UserID","ProyectoID")= [ProyectoID]
  )
)

or

OR(
  LOOKUP(USEREMAIL(),"Usuarios","UserID","ROL")= "Admin",
  AND(
    LOOKUP(USEREMAIL(),"Usuarios","UserID","ROL")= "Usuario",
    IN(USEREMAIL(),[ProyectoID].[Related Usuarios])
  )
)

or, equivalent (assuming [ROL] is Admin or Usuario only):

SWITCH(LOOKUP(USEREMAIL(),"Usuarios","UserID","ROL"),
   "Usuario", LOOKUP(USEREMAIL(),"Usuarios","UserID","ProyectoID")= [ProyectoID],
   true
)

or

SWITCH(LOOKUP(USEREMAIL(),"Usuarios","UserID","ROL"),
   "Usuario", IN(USEREMAIL(),[ProyectoID].[Related Usuarios]),
   true
)

Steve
Platinum 4
Platinum 4

The users slice probably doesn’t include the ProyectosID column of the Usuarios table.

Thank you both @Steve and @Aurelien !

@Steve you’re right, it worked after i did this, ProyectosID Column was not included in the slice. I added that column after creating the table Usuarios and i tough the column will be added instantly as well.

@Aurelien This last formula worked just fine! thank you

SWITCH(LOOKUP(USEREMAIL(),"Usuarios","UserID","ROL"),
   "Usuario", IN(USEREMAIL(),[ProyectoID].[Related Usuarios]),
   true
)

Wish i could give you both the solution check.

Top Labels in this Space