I know how to make a simple dynamic menu and filter it based on two conditions (True or False), using Slice and Behavior.
This is the Slice I am currently using.
However, I'd like to be able to filter it even further if possible.
Example: No profile/profile created. And if a profile has been created, then filter on Customer/Internal staff. And if Internal staff, then filter based on roles.
I understand that multiple Slices and Views can be created that can be hidden/shown based on the different combinations, but I am hoping that there is a way to create only one Slice/View with one expression that would filter/cover everything.
Ideally, something like this in the Slice's Row filter condition:
I don't think what I am asking is possible based on my research, but though I ask those more knowledgeable. Thanks!
Solved! Go to Solution.
Thank you. In general you can explore the following approach. The approach is described with respect to the sample app you have shared.
You could add two columns of [Department] and [Role] in the Menu table.
The columns should have values of departments and roles for which that menu view needs to be visible.
Then in the slice filter you could add those conditions such that if the current user's ( identified by USEREMIL() ) department and role are matching with those listed for that view in the Menu table, then that view is available for viewing by that user.
To get the department and roles of the logged in user without using SELECT() formulas , you could use the Current User system suggested by @MultiTech in the tip below.
Current User (Slice) | How to conform your app a... - Google Cloud Community
Finally , please be aware that hiding a view from a user through show_if or similar methods is not same as preventing the related data from reaching the user's device. For a impeccable method to ensure even data does not reach a user's device , you need to use security filters.
User | Count |
---|---|
15 | |
11 | |
10 | |
8 | |
3 |