Conditional IF statement to control button enabled for different users
Question

Hi All,

Currently I am developing a flow that allows different button based on the conditions as below:

If Agent A pick up the request first, he should see the close button.

But,

If the request is assigned to Agent B, at this moment only agent B should see the close button, while Agent A is not supposed to see the close button.

Vice versa,

If the request is not assigned to Agent B, Agent A should see the close button as usual.

I would expect that you set the visibilityproperty of the button to 'Entity.AssignedUserId = GetUserId()'. another option is to encapsulate the button by an If widget and put that logic as condition to the if.

and perhaps you want to add ' or Entity.AssignedUserId = NullIdentifier()' or some other logic to the condition

Hans

Hans Dollen wrote:

I would expect that you set the visibilityproperty of the button to 'Entity.AssignedUserId = GetUserId()'. another option is to encapsulate the button by an If widget and put that logic as condition to the if.

and perhaps you want to add ' or Entity.AssignedUserId = NullIdentifier()' or some other logic to the condition

Hans

 Hi Hans,

I am using an server action that have a list of booleans to control each button in my form. So I wish not to hard code inside the button properties.

 

hi, can you provide the example? 

you can assign the condition to every record in your list of booleans as well.

Champion

Hi,

You can use list widget to itrate over list of booleans and use If widget to deliver buttons conditionally..

still have doubts please share more information...


Thanks!!

Hi All,

I just want to know how to enable/disable button based on roles 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.