Dynamic menu

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.

 

Pejme_1-1669176580602.png

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:

Pejme_2-1669177819363.png

I don't think what I am asking is possible based on my research, but though I ask those more knowledgeable. Thanks!

Solved Solved
0 6 435
1 ACCEPTED 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.

Suvrutt_Gurjar_0-1669219776673.png

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.

 

 

 

View solution in original post

6 REPLIES 6

You may want to make your requirement clearer. 

For example may we know,  if you wish to give the selection choice to users or based on role of users you wish to show the user fixed records that user is eligible to see as per roles . profile etc.

 

@Suvrutt_Gurjar Thanks for your reply.

I don't want to give the user the option to choose. At first, everyone will see the same and only option, which is to create a profile (1).

After that, based on the company and the role, if they are staff, they have specified, their menu will be customized showing only options relevant to them.

The customer will only see their profile (2).

Sales staff will see all the customers (3).

Accounts will only see transactions (4).

Admin staff will see everything (2-4).

Pejme_0-1669190499637.png

Hope I am being clearer ๐Ÿ™‚ 


@Pejme wrote:

Hope I am being clearer :slightly_smiling_face: 


Thank you. Somewhat but I am afraid not entirely.  ๐Ÿ™‚ The description has raised more questions. ๐Ÿ™‚


@Pejme wrote:

I don't want to give the user the option to choose. At first, everyone will see the same and only option, which is to create a profile (1).


Can each user including customer create his own profile? Also by the only option do you mean a form?  Also how "at first" will be defined?


@Pejme wrote:

The customer will only see their profile (2).


I believe it will be on the same table as wherein form in step 1 is created. Is it correct?


@Pejme wrote:

Sales staff will see all the customers (3)


Are the customers from the same table as in step 1?


@Pejme wrote:

Accounts will only see transactions (4).


What are these transactions? Are these in the different tables from where profile is created?

I think if you could share more about your table(s) / columns and their relationship if there are more than 1 table involved it will be help.

 

 

 

 

@Suvrutt_Gurjar Sorry for being confusing. The information I provided are just examples to illustrate what I am trying to ask, so, unfortunately, I don't have much to share.

I want to create a menu similar to this one.
https://www.appsheet.com/templates/This-App-helps-organizations-digital-manage-their-hybrid-work-env...

Menu view when a profile hasn't been created yet:

Pejme_3-1669194945530.png

 

Menu view after a profile has been created:

Pejme_4-1669194982249.png

 

Actually, I know how to create this type of menu. However, I want to be able to customise the menu view even further. The app that I am referencing will show you one of the Menu table rows if you haven't created a profile, and the rest once you have created a profile. Then the Behavior will take you to the View Link destination when you click on it.

Pejme_0-1669194191957.png

Pejme_1-1669194244688.png

Pejme_2-1669194692931.png

 

The referenced app only filters based on if the user is in the directory or not. I want to filter based on multiple criteria. I gave some examples in my previous post, but they are just examples. I am more after understanding if what I am asking to do is possible, and how it works conceptually.

I would like to take this one step further, so that once I have created a profile, the app will show the user different views based on the information the user provided when they created a profile.

I understand that I can create the illusion of a filtered view if I create multiple slices/views/tables, but I want to see if it is possible to create a dynamic menu with only one slice/view/table.

 

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.

Suvrutt_Gurjar_0-1669219776673.png

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.

 

 

 

@Suvrutt_Gurjar Thanks! So obvious when you point it out ๐Ÿ™‚ Sometimes, I don't see the forest for the trees haha.

Special thanks for the sidenote about show_if vs. security filters!

Top Labels in this Space