App views only displaying based on a selected input

aglass
New Member

Hello everyone,

I need our app users to first select a company location, and depending on the location selected the the tables relating to that location would display in the Main Nav.

For example I have 3 locations, and two sets of tables for each of the 3 locations. When one location is selected, I only want the two tables relating to that location showing in the App nav bar.

Iโ€™ve also included an image of the app nav as is along with the google sheet Iโ€™m working off to better provide an idea how it is currently set up (which may not at all be correct).

Thanks!

Solved Solved
0 15 1,034
1 ACCEPTED SOLUTION

@aglass
Try with this:

IN(โ€œMaplewodโ€, LIST(USERSETTINGS(โ€œStoreโ€)))

View solution in original post

15 REPLIES 15

Steve
Platinum 4
Platinum 4

Youโ€™ll need to capture the userโ€™s store choice and save it. Then you can reference the saved value in the Show if expression of your view configuration to only display the view of the selected store. Alternatively, you could create a slice that only includes the selected store, then have a single view that references the slice.

To capture the userโ€™s store choice, the easiest method is to use User Settings:

Thanks for the tip! does either method you suggested put less of a strain on the app to provide a smoother user experience?

Also after the user selects a store choice, he/she can change that choice to view another store if need be, correct?

I donโ€™t understand.

Technically, thatโ€™s up to you and the design you choose, but thereโ€™s no technical reason to deny the user the ability to change their choice.

My first question was just related to best practices. I wanted to know if one method is considered better than the other or offers any significant advantages

As for the user selecting a different store, thatโ€™s what I was hoping!

Iโ€™m having difficulty setting up the expression however. Iโ€™ve set the option in user setting however the expression is returning an error. See image below

Also After I enabled that store user setting to be viewed, I could not locate it anywhere in the app.

Ah, right! User Settings is the easiest to setup, but the least flexible, and likely to be a less-friendly user experience. It might be a good way to get something working quickly, then you could move to a better approach later.

3X_7_d_7d07802837cced1e7ba6883d0ec44efb6ed0e56b.png

Instead:

USERSETTING("Store") = "Maplewood"

Note quotes rather than brackets.

Itโ€™s in the appโ€™s main menu:

3X_5_7_572138a5fbbb7e0392b2a26d75b593da813eedaa.png

I tried adjusting the expression, but now Iโ€™m receiving a different error.

Thanks for pointing me in the right direction for where to locate the user settings within the app! Is there a way to add this specific user setting as a primary view? Ultimately Iโ€™d like for that to be the only icon upon opening up the app.

Opps! This:

3X_2_e_2e31abedd7c4de14e6e6f5cc17e414b819b70d49.png

is because I overlooked this:

3X_e_c_ec967514eb90fa215a7cc451f4f56722808f5074.png

Your expression should instead be:

IN("Maplewod", USERSETTINGS("Store"))

I would question, though, why Store is of type EnumList rather than just Enum. Do you intend for the user to choose multiple stores simultaneously?

See also:


I changed the type to Enum (you are correct that Iโ€™d only want to select one). I also changed โ€œStoreโ€ to โ€œLocationโ€ within the user settings to match it with our company vocabulary. I tried the expression you gave and it appeared to work at first. However when I saved it and went back into to the app and tried selecting one of our three locations, this error occurred.

Then Is there a way to add this specific user setting as a primary view? Ultimately Iโ€™d like for the location selection to be the only icon upon opening up the app

@aglass
Try with this:

IN(โ€œMaplewodโ€, LIST(USERSETTINGS(โ€œStoreโ€)))

Thanks Levent,

It looks like your formula worked with the Enum setting. However the App preview screen is blank for some reason so I canโ€™t tell if the desired effect has been achieved???

App preview|690x434

I restarted my computer and the app preview has come back. Moreover the formula you provided is exactly works perfectly!

Now Is there a way to add this specific user setting as a primary view? Ultimately Iโ€™d like for the location selection to be the only icon upon opening up the app. And Iโ€™d like for it to always be accessible from the primary view

Yes itโ€™s possible for sure.

How can I set the app up so that the user setting is located in the primary view?

The expression I provided was appropriate for a column of type EnumList, not for a column of type Enum. With an Enum column, your original express was correct:

("Maplewod" = USERSETTINGS("Location"))

One problem at a time.

Top Labels in this Space