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

Help with If statement

Hi

I have the following on my DefaultMode of my form allowing me or MyReviewer to be able to edit this section and it works:

If(VarUser = MyReviewer || VarUser = "MyEmail", FormMode.Edit, FormMode.View)

I now need to change the defaultmode so if this reviewer has responded I want to set the form mode to view something like this:

If(IsBlank(VarRecord.PartGReview),FormMode.View, FormMode.Edit)

 Firstly I'm not sure how i combine both statements, but secondly I would like the ability to retain the ability to edit the form and make it view only for all other users.

 

Thank You 

1 ACCEPTED SOLUTION

Accepted Solutions

I think i missed that you want it to only be view mode for anyone who is not reviewer or yourself. In that case you would need:

 

If(VarUser = "MYEMAIL", FormMode.Edit, If(varUser = MyReviewer, If(!IsBlank(varRecord.PartGReview), FormMode.View, FormMode.Edit), FormMode.View))

 

View solution in original post

9 REPLIES 9
mdevaney
Super User III
Super User III

@Lefty 

Does this solution work?

If(VarUser = MyReviewer Or VarUser = "MyEmail" And !IsBlank(VarRecord.PartGReview), FormMode.Edit, FormMode.View)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

HI @mdevaney 

I was just replying to my original post:

 

I think I have got it working, without me having edit rights, so just need help with that (I need edit even when the form mode is view for everyone ), unless anyone spots any flaws with this:

 

 

If(!IsBlank(VarRecord.PartGReview),FormMode.View, FormMode.Edit  Or 
If(VarUser = MyReviewer || VarUser = "MYEMAIL", FormMode.Edit, FormMode.View))

 

 

I tried this and doesn't work:

 

If(VarUser = "MYEMAIL", FormMode.Edit Or
If(!IsBlank(VarRecord.PartGReview),FormMode.View, FormMode.Edit  Or 
If(VarUser = MyReviewer || VarUser = "MYEMAIL", FormMode.Edit, FormMode.View)))

 

I'll give your suggestion a try now

 

HI @mdevaney 

 

Afraid this doesnt set the form to view only, my understanding of the statement is
if VarUser is me and that field is not blank, the form mode is edit, else its view?

 

maybe my 2nd post with the code i've half got working, explains better what I am trying to do, sometimes its difficult explaining things precisely.  

Hi @mdevaney 

 

Any further help will be appreciated 

VijayTailor
Resident Rockstar
Resident Rockstar

Hi Lefty,

As i understand from the below Comments ,

Your Requirement is like below (Correct me if, I am wrong).
if LoggedIn user is equal to your mail ID and VarRecord.PartGReview is not blank then Form Mode should me Edit Mode, but if LoggedIn User = MyReviewer ID and VarRecord.PartGReview is not blank then Form Mode is View Mode else Form Mode id Edit Mode. 

 

below Formula help for this Condition that I mentioned above

If(VarUser = "MYEMAIL" && !IsBlank(VarRecord.PartGReview), FormMode.Edit ,
If(!IsBlank(VarRecord.PartGReview) && VarUser="MyReviewer",FormMode.View, FormMode.Edit)).


Please check and Mark as answer if this solution help you to resolve your issue

Hi @VijayTailor 

 

Thanks, I will use your understanding to explain this further:

 

If LoggedIn user is equal to your mail ID and VarRecord.PartGReview is not blank then Form Mode should me Edit Mode (basically i want the form mode to be edit for myself at all times),
but if LoggedIn User = MyReviewer ID and VarRecord.PartGReview is not blank then Form Mode is View Mode else Form Mode id Edit Mode.
If LoggedIn User = MyReviewer ID and VarRecord.PartGReview is blank then Form Mode is Edit Mode else Form Mode View

and for all other users it should be view anyways.

@Lefty 
Looks like I missed your follow-up posts on Friday @VijayTailor has taken over.  That's OK, I'll let him carry this forward.

Duhorothy
Frequent Visitor

I think you are going to need some nested If statements.

The code you said was working besides always giving yourself FormMode.Edit:

If(VarUser = "MYEMAIL", FormMode.Edit Or
If(!IsBlank(VarRecord.PartGReview),FormMode.View, FormMode.Edit  Or 
If(VarUser = MyReviewer || VarUser = "MYEMAIL", FormMode.Edit, FormMode.View)))

 

How i think it can work.

If(VarUser = "MYEMAIL", FormMode.Edit, If(varUser = MyReviewer && !IsBlank(varRecord.PartGReview), FormMode.View, FormMode.Edit))

 

Let me dissect this to explain a little:

If(VarUser = "MyEmail", 
FormMode.Edit,True Value: if it IS you it will always be edit
If(varUser = MyReviewer && !IsBlank(varRecord.PartGReview),Else Value: if its not you, check if it is your reviewer AND the partGreview is not blank
FormMode.View,True value: if BOTH of these conditions are true
FormMode.Edit))Else Value: If either of these are NOT true 

 

I think i missed that you want it to only be view mode for anyone who is not reviewer or yourself. In that case you would need:

 

If(VarUser = "MYEMAIL", FormMode.Edit, If(varUser = MyReviewer, If(!IsBlank(varRecord.PartGReview), FormMode.View, FormMode.Edit), FormMode.View))

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (43,505)