Show or hide control dynamically, based on the user or other condition?

I’d like to show or hide controls based on the usergroup of the logged-in user. (as well as other possible conditions).

I know that I can show or hide a control, but I don’t know how to do that dynamically based on a condition.

Can I do something like IF(X is true) show the control, ELSE hide the control. ?

Hi @mbrodeur ,

You can achieve this via Rules.

Let us assume you want to show or hide certain controls based on user group. In this case, you can use 1 text input control (named user group) to fetch the logged-in user’s usergroup and hide it if you don’t want to show it to end users. Or create an app-level variable for the user group and assign the corresponding value to it at the run time on the home screen’s screen open action flow.

Now apply Rules on the desired screen. Create a new Rule here by clicking on the Add New Rule button and set the condition you want to check (say usergroup = “HR”). Then in it’s If Condition True section, show or hide the controls as required and Add Reverse of True in the If Condition False section. And finally, click on the Save button at the top right corner of the Rules window.

Here is a sample snapshot for your reference.

Click Here to redirect to the Applying Rules article.

I hope this will help. :slight_smile:

Interesting I’ll try that