"cannot compare list with text in" in slices

Good evening everyone,

I need assistance with this matter, and i haven´t found someone with the same error as myself among the existing treads.
I want to filter the data of my app based on user roles as described on this tutorial

Ever since i have done everything as the tutorial says but, i ran into a error in when i try to filter the data in the security field, using a slice, as shown in the images:



And this is the error i get:

I’ve been frustrated with this error for a while now and i can’t find where i’m wrong

Solved Solved
0 16 1,103
1 ACCEPTED SOLUTION

Thank you @Steve and @SkrOYC, i made it work with this expression with the help of you both

OR(
IN(“Admin”, user[ROL]),
AND(
IN(“Usuario”, user[ROL]),
ANY(user[Lugar])=[Lugar]
)
)

View solution in original post

16 REPLIES 16

Steve
Platinum 4
Platinum 4

What is the column type for the LUGAR column of the Inventario table?

El filtro es para definir cuáles filas mostrar. Para ello se debe indicar una expresión que cada fila va a evaluar y así definir si ser incluida o no.
Por favor indicarnos qué columnas tiene la tabla “Inventario” y qué filas necesitas filtrar de dicha tabla en base a los usuarios.
Puedes describirlo en palabras y haré lo que pueda para entenderte, pero necesitamos primero una foto de la tabla que te indiqué.
Por otro lado, si en lugar de filtrar algunas filas necesitas ocultar la tabla por completo dependiendo el rol, eso se hace en la vista bajo el apartado UX e indicar Show_If
Si tu objetivo es que se cambien los permisos de edición, eso se hace en la vista bajo el apartado Data “Are updates allowed?”
Quedo atento!

Sí, el filtro es para que los usuarios vean solo los datos asociados a su LUGAR, en este caso si en la tabla Empleados están dados de alta en el LUGAR de Peñasquito, solo deben ver los datos de Agua y Emulsión Asfáltica pertenecientes a peñasquito:

Pero si es un administrador, pueda ver todo.
Gracias por el apoyo!

Notado.
Tu fórmula está correcta, excepto que escribiste “Addmin” en lugar de “Admin”.
Te recomiendo cambiar la columna Lugar a “Enum” y así controlas con opciones qué lugares están disponibles para cada usuario, incluso permitir agregar alguno.

Gracias por notar esa d de más, pero ya lo he escrito varias veces y aun así no funciona
No se a que se deba.

This is the columns from the table Inventario

Try this as your security filter:

OR(
  IN("Addmin", user[ROL]),
  AND(
    IN("Usuario", user[ROL]),
    IN([LUGAR], user[LUGAR])
  )
)

Thank you! it does works for “Admin” now, but it can not filter the data for “Usuario” now.
Admin:

Usuario:

Try this instead:

OR(
  IN("Admin", user[ROL]),
  IN("Usuario", user[ROL])
)

What about the place?? They need to filter the data also taking into account wich place is allowed for a certain worker. I have to admit I’m a little bit lost

Debugging. Test the individual parts. We know the Admin test works, so try adding just the Usuario test.

IFS(
  INDEX(User[ROL],1)="Admin", true,
    AND(
      INDEX(User[ROL],1)="Usuario",
      INDEX(User[LUGAR],1)=[LUGAR]
    ), true
)

Me marco el mismo error que con el IFS, como que específicamente esa expresión no la acepta.

Favor envíanos una imágen de las columnas que componen la tabla Empleados mostrando los tipo de columna

Claro, así se compone la tabla Empleados.

Thank you @Steve and @SkrOYC, i made it work with this expression with the help of you both

OR(
IN(“Admin”, user[ROL]),
AND(
IN(“Usuario”, user[ROL]),
ANY(user[Lugar])=[Lugar]
)
)

Top Labels in this Space