Showing results for 
Search instead for 
Did you mean: 
Post Prodigy
Post Prodigy

Help with if statement


This is what I am trying to do, I have a submit button and on the DisplayMode property of the button I am trying to:

If the logged in user is Reviewer4, the button should be clickable (edit), else it should be disabled for all other users. I can get this to work.

But when Reviewer4 clicks the button to submit the form, I have another variable vWait, which needs to disable the button even for Reviewer4 , until it successfully submits or if it fails, I can't get the syntax correct to cater for 2 different if statements:

VarUser = Reviewer4, DisplayMode.Edit, DisplayMode.Disabled);// semi colon or comma and it complains
If(vWait, DisplayMode.Disabled,DisplayMode.Edit)



Hi @WarrenBelz 

Yes Thats correct, once vWait is true, the button should become disabled, and no it would not affect anything else... as the button is only clickable to Reviewer4, but from the code, i understood it as though there 2 conditions to be met for the function to kick in?



I've just had a thought,

if put the following on the Visible property of the button, then only this user will see the button:

VarUser = Reviewer4

Then on the DisplayMode of the button I can simply put:


vWait, DisplayMode.Disabled,DisplayMode.Edit


Your thoughts?

View solution in original post


Hi @Lefty ,

Without seeing the rest of your logic, yes this should work. My previous thought probably would as well as once vWait became true (on the first click), the DisplayMode of the button would be Disabled


Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,321)