Using a CheckRole
Hello I'm new here in the outsystems world, i would like to know how to send the return checkadmrole.Hasrole to a local variable.

I would like to use this to enable or disable two buttons depending on the user's level.

Rank: #177

Hi Kleber,

In your preparation, drag and drop the rule, and set the retunt to variable local, example:

After, put this variable in your botton (option Enabled), example:


Rank: #270

In the preparation of your screen(Where you want to enable or disable the button), add assignment  and  assign your local variable with HasRole property value.

Rank: #603


The previous answers will help you achieve what you are looking for. However, I would like to add some more information. 

You can pass the output to a local variable, but also you can use the function directly as displayed in the following images:

1) If you do a double click in the Enabled property, you can reach the editor  and you have the information displayed above.

2) In that property use the function to check a specific role. 

3) Like this one

Best Regards,

João Delgado