Slice table by user category

Hello,

I'm creating a multi-organization app that allows each organization that accesses using its own email account to view only the product that refers to it

I've the following tables with the following columns:
• Products (id, name, organization)
• Organizations (id, name, email address)

I'd like to slice the product table by showing products that relate to a specific organization only to users that access the app using the email that ref to that specific organization.

Can you help with the right expression to use?

Thanks

Solved Solved
0 4 179
1 ACCEPTED SOLUTION

Try

[organization]
=
LOOKUP(
 USEREMAIL(),
 "Organizations",
 "email address",
 "id"
)

here [organization] in products table stores Organization id, not its name.

View solution in original post

4 REPLIES 4

Try

[organization]
=
LOOKUP(
 USEREMAIL(),
 "Organizations",
 "email address",
 "id"
)

here [organization] in products table stores Organization id, not its name.

nope, doesn't work

@TeeSee1 sorry my mistake, it works thank you!

The only thing remaining to do is to let a super admin user see all of entries.

Suggestions?

Use OR()

OR(
 USERROLE() = "Admin",  <- replace with an expression that identifies admins as required
 ****place the expression already created here***
)
Top Labels in this Space