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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,324)