cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
Post Prodigy
Post Prodigy

Help with if statement

Hi

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:

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

 

12 REPLIES 12

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?

@WarrenBelz 

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

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,417)