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 / Non-sequential order o...
Power Apps
Unanswered

Non-sequential order of execution (is there a way to disable multithreading?)

(1) ShareShare
ReportReport
Posted on by 8

Greetings all, 
I have a test canvas app. three checkboxes and a button. 

 

If(Checkbox1,
Navigate(msgScreen, ScreenTransition.None,{alertMsg:"checkbox 1"}),
//else-default
Navigate(msgScreen, ScreenTransition.None,{alertMsg:"No checkbox 1"})
);

If(Checkbox2,
Navigate(msgScreen, ScreenTransition.None,{alertMsg:"checkbox 2"}),
//else-default
Navigate(msgScreen, ScreenTransition.None,{alertMsg:"No checkbox 2"})
);

If(Checkbox3,
Navigate(msgScreen, ScreenTransition.None,{alertMsg:"checkbox 3"}),
//else-default
Navigate(msgScreen, ScreenTransition.None,{alertMsg:"No checkbox 3"})
)

 

In other environments, the program would check status of Checkbox 1 first, then execute the check for Checkbox 2...etc
I know I can use 'Notify', but I was looking for a more general way to enforce order of execution, and disable multi-threading for an individual screen. Any advice?
Doug

Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    Multiple If functions terminated by semicolon is why you get this issue.


    Try instead just one If function with each clause separated by commas, like this:

    If(
     Checkbox1,
     Navigate(msgScreen, ScreenTransition.None, {alertMsg:"checkbox 1"}),
     Checkbox2,
     Navigate(msgScreen, ScreenTransition.None, {alertMsg:"checkbox 2"}),
     Checkbox3,
     Navigate(msgScreen, ScreenTransition.None, {alertMsg:"checkbox 3"}),
     //else-default
     Navigate(msgScreen, ScreenTransition.None, {alertMsg:"No checkbox selected"})
    )
    

    See if it helps @TW-Doug 

  • TheRobRush Profile Picture
    11,128 Moderator on at

    How about this

    If( 
     Or(Checkbox2, Checkbox3, Checkbox4),
     Concurrent(
     Set(msg1, If(Checkbox2, "Check Box 2", "Not Check Box 2")),
     Set(msg2, If(Checkbox3, "Check Box 3", "Not Check Box 3")), 
     Set(msg3, If(Checkbox4, "Check Box 4", "Not Check Box 4"))
     );
     Navigate(Screen1);
     Notify(Concatenate(msg1," ",msg2," ",msg3," "),NotificationType.Information)
     )
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @TW-Doug 

    I would also add this: If you always navigate to the exact same screen and pass in the exact same record into the context of the screen you may consider to have the Navigate outside the If to avoid repeating the same Navigate function declarations:

    Navigate(
     msgScreen, 
     ScreenTransition.None, 
     {
     alertMsg: If(
     Checkbox1, "checkbox 1",
     Checkbox2, "checkbox 2",
     Checkbox3, "checkbox 3",
     "No checkbox selected"
     )
     }
    )
    


    However, the version I gave initially may be more straightforward so you may want to keep it then.
    It's also better, in case you are actually potentially navigating to different screens.
    If it's exactly the same screen and you are sure about it, then the above may be better though to avoid repetition.

  • TW-Doug Profile Picture
    8 on at

    Perfect. that is exactly what i needed. Thanks for the quick response


    I did notice that in docs, but it didn't register
    IfCondition1ThenResult1 [, Condition2ThenResult2, ... [ , DefaultResult ] ] )
    If and Switch functions in Power Apps - Power Platform | Microsoft Learn

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard