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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multiple actions in ne...
Power Apps
Answered

Multiple actions in nested IF statements

(0) ShareShare
ReportReport
Posted on by 19

Hello.  I am a new (and non-technical) user and could use help. 

 

On the first page of my app, I have a form (MainForm) where most of the fields are required.  I have nested IF statements on the "next" button instructing PowerApps to navigate to screen FailureScreen if any of the required fields are blank/empty.  If all required fields are not blank, then I want PowerApps to submit the form to my SP List AND I want to navigate to the next screen (profile pic) in my app.

 

This is what I have right now for the "Next" button OnSelect property:

If(IsBlank(FirstName),Navigate(FailureScreen),
If(IsBlank(LastName), Navigate (FailureScreen),
If(IsBlank(DisplayName), Navigate (FailureScreen),
If(IsBlank(HomeAddress), Navigate (FailureScreen),
If(IsBlank(MobileNumber), Navigate (FailureScreen),
If(IsBlank(EmailAddress), Navigate (FailureScreen),
If(IsBlank(StartDate), Navigate (FailureScreen),
If(IsBlank(EmployeeType), Navigate(FailureScreen),
If(IsBlank(OfficeLocation), Navigate(FailureScreen),
If(IsBlank(ManagerName), Navigate (FailureScreen),
If(IsBlank(Birthdate), Navigate (FailureScreen),
If(IsBlank(Technology), Navigate (FailureScreen),SubmitForm(MainForm))))))))))))) ;
Navigate('profile pic')

 

PowerApps is correctly writing to my SP List when all fields are full, but it always navigates to ProfilePic screen even if a field is left blank because it's the last command and not conditional.

 

How can I navigate to screen ProfilePic after the form is submitted AND only if all required fields are not empty?  Thanks for your help.

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Try this

    If(
     Or(
     IsBlank(FirstName),
     IsBlank(LastName),
     IsBlank(DisplayName), 
     IsBlank(HomeAddress),
     IsBlank(MobileNumber),
     IsBlank(EmailAddress),
     IsBlank(StartDate), 
     IsBlank(EmployeeType), 
     IsBlank(OfficeLocation), 
     IsBlank(ManagerName), 
     IsBlank(Birthdate), 
     IsBlank(Technology)
     ), 
     Navigate (FailureScreen),
     SubmitForm(MainForm);
     Navigate('profile pic')
     )

     

    Though long term I would recommend changing up colors/ italics, or having small messages below/to side of input areas that are required that disappear once the requirements for that control have been met and setting your buttons display mode to DisplayMode.Disabled until all requirements are met, and only swithc to displaymode.edit when all are good to go. Less confusing then jumping around screens GUI UX wise I think

  • Verified answer
    WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @nstoney ,

    Put this on your button

    If(
     IsBlank(FirstName) || IsBlank(LastName) || IsBlank(DisplayName) || IsBlank(HomeAddress) ||
     IsBlank(MobileNumber) || IsBlank(EmailAddress) || IsBlank(StartDate) || IsBlank(EmployeeType) ||
     IsBlank(ManagerName) || IsBlank(Birthdate) || IsBlank(Technology), 
     Navigate (FailureScreen),
     SubmitForm(MainForm)
    )

    and this on the OnSuccess of the Form

    Navigate('profile pic')

     

    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.

    Visit my blog Practical Power Apps

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Oh for sure, that navigate placement is much better, good catch @WarrenBelz 

  • nstoney Profile Picture
    19 on at

    Thank you to all from this newbie!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard