web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Form Default Mode - Ne...
Power Apps
Unanswered

Form Default Mode - Nested Ifs not working

(0) ShareShare
ReportReport
Posted on by

I have a dynamic link in an email to open a Powerapps form. Based on the status field in SP when the dynamic link is used Powerapps should see the status field is "X" open the form in "Y" mode. It works if I have a simple formula like:

If(!IsBlank(variableIDforDeepLink), FormMode.Edit,FormMode.New)But this does not address my need

 

But this is what I need to work:

If(!IsBlank(variableIDforDeepLink) && status.text= "Need More Info" || status.text="Pending" && !IsBlank(office),FormMode.Edit, If(status.text="Approved" || status.text="Rejected",FormMode.View,FormMode.New))

 

When I use the complicated logic it keeps showing a new form when I open the link even though it should be opening in other modes.

P.S. I also tried using the Switch functionality

Switch(Status.Text,"Need More Info",FormMode.Edit,"Approved",FormMode.View,etc.

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @mjackson122 

    You need to use parentheses to distinguish the priority of your AND's and OR's.

    For example, is it !IsBlank(variableIDforDeepLink) && status.text= "Need More Info" that needs to be evaluated to true or false and then OR'ed with status.text="Pending" or is it status.text= "Need More Info" || status.text="Pending" that needs to be evaluated to true or false and then AND'ed with !IsBlank(variableIDforDeepLink)?

     

    PowerApps is just going to guess...and it will be wrong!

     

    So, since I am not able to decipher it either, I will guess as well and suggest the following formula:

    If(
     !IsBlank(variableIDforDeepLink) && 
     (status.text= "Need More Info" || status.text="Pending") && 
     !IsBlank(office), FormMode.Edit, 
     status.text="Approved" || status.text="Rejected", FormMode.View,
     FormMode.New
    )

     

    I hope this is helpful for you.

  • mjackson122 Profile Picture
    on at

    It is IsBlank(variableIDforDeepLink) needs to be true AND then status.text= "Need More Info" || status.text="Pending"  AND !Isblank(office) that needs to be evaluated to true. The pending and office go together and both need to be true for the form to be in edit mode

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @mjackson122 

    Yes, so put parens around the priorities of your logic.

    If I am reading what you are saying right, then it would be:

    If(
     !IsBlank(variableIDforDeepLink) && 
     (status.text= "Need More Info" || (status.text="Pending" && !IsBlank(office)), 
     FormMode.Edit, 
     status.text="Approved" || status.text="Rejected", FormMode.View,
     FormMode.New
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard