Starting view issue

Hello!

I had a condition in Starting view:
IF(
(USERROLE()=“Admin”), “Home”,
“General”
)

But when I change the user in the emulator to a user with (USERROLE()=“User”), the condition is not working properly, it shows a view that has a view condition (USERROLE()=“Admin”), but in the primary views the expression on the Starting view is working OK.

The “preview as” functionality does not really work 100%. Your expression looks correct.

2 Likes

What do you mean with this?

I’m assuming you entered a different user’s email address here:


In order to test the functionality of your USERROLE()-based expression here:

I’m saying the “preview as” doesn’t really work quite as you’d expect and you won’t be able to properly test this expression using it, but that your expression appears to be correct so it should work as you’re wanting.

Although maybe I misread, since the following doesn’t really make much sense to me:

1 Like

Views that I have:
“Home” Display Show if condition= (USERROLE()=“Admin”)
“General” Display Show if condition= (USERROLE()=“User”)
“Personal” Display Show if condition= (USERROLE()=“User”)

If a (USERROLE()=“User”) opens the App, the first view that the App shows is: “Home” and it must show “General” as a view. So is not workin properly, neither the expression nor the condition if the user is: (USERROLE()=“User”)

How do you know it is not working? Are you using the “preview as” in the emulator, or are you actually using the app with a different user’s sign-in?

In the emulator, if I use the App is ok, is working fine.

1 Like

I agree with Mark. The preview as a certain user, though much improved this year, still has issues. In other words, something may work perfectly for that user when logged in on a phone or browser but previewing as that user in the emulator may not work as expected.