In my application, I have three roles employee, travel desk and manager. so I have a container(travel desk) which should be only visible to travel desk, also have a button which should be only visible to manager. How to do this?
So you need to get the roles using a data action to check for the roles, after that inside of the visible widget you can put a condition to be visible in case they have the "x" role.
Add an output parameter to see if has the role, the data type will be boolean for both
Call the action check role that you have in the role actions, first drag the run server action to the data action
Assing the output
And do the same for the travel desk role inside of the data action
Then on the visible input in the container open the expression editor
Call the output of the data action
And that's it, now is going to be visible if the logged user has the role.
There is also another post explaining this
https://www.outsystems.com/forums/discussion/62878/how-to-define-seen-or-unseen-button-with-roles-in-reactive-app/
Regards,
Márcio
Hi Marcio,
Can you please elaborate on how to check roles using data action?
Shalini
Thank you so much Marcio for the solution