"Show If" conditions based on USERROLE() not working

I have an app with a number of views and fields that are set with display conditions based on USERROLE(), specifically to show only if USERROLE()="Admin". Starting on Friday, on the first instance that the app is launched in a browser session, none of the views or fields that have that condition are displayed. (Any view that has Show If set to USERROLE()="Admin" is treated as if that condition evaluates to false.

This only happens on the first instance that the app is launched in a browser session. If I open the app in the editor, the version in the preview pane shows everything correctly, and if I launch the desktop preview from the editor, that version runs as it should. Same thing if I launch the app in a new browser session, log out of Google, launch again and sign in. Then, everything works correctly.

My role in the app is Admin.

To confirm that something is not right, I created a field "user_role" with the value "USERROLE()"; a text field with the condition to show if [USERROLE()="Admin"], and another text field with the condition to show if [NOT(USERROLE()="Admin")]. When I open the view in the application (launched in the browser and not from the editor), the "user_role" displays the value "Admin". However, the field that's set to show if [USERROLE()="Admin"] is not displayed, and the field that is set to show if [NOT(USERROLE()="Admin"] is displayed. These should be mutually exclusive, so it appears that even though the app is displaying the value of USERROLE() to be "Admin", for purposes of applying the Show If condition, it's seeing the user as NOT being an Admin (as if USERROLE()="Admin" evaluates to false).

I get the same result whether I run my stable or latest version. When I open a fresh browser window, and launch the app directly, anything that's conditioned on "USERROLE()="Admin" is treated as if that condition evaluates to false.

I'm wondering if this is a bug in the platform?

0 4 232
4 REPLIES 4

Usersmail() Functions not working today 

As of yesterday afternoon, USEREMAIL() was working fine -- it was USERROLE() that was not working. Specifically, any condition that was set to USERROLE()="Admin" was treated as if it evaluated to false (so admin-only views were not displayed, same for fields on detail and form views that had show-if set to USERROLE()="Admin".

USERROLE() stopped for me to. Only USEREMAIL() works now.

Anyone find the cause?

Dear @jeffreysharer @BRAVETech 

Have you experienced any improvement on the reliability of USERROLE()  ? I am hesitant to use it and I'm thinking about building a user table as described here instead

Thank you

Top Labels in this Space