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 / Struggling with multip...
Power Apps
Answered

Struggling with multiple IF conditions (as a programmer)

(0) ShareShare
ReportReport
Posted on by 65

Hi guys

I am struggling a lot with the syntax of Power apps. I am never quite sure how many semicolons i have to use.

Even worse, i dont know how to stack multiple if statements within eachother:

 

If ('Form_Certification_Process_Basic-Info'.Mode = FormMode.New;
 If (IsBlank(Applied_Role_DataCardValue.Selected.Value);
 Notify("The Required Field 'Applied Role' under Basic-Info can't be empty"; NotificationType.Error;2000);
 Patch(
 'Certification Process';
 Defaults('Certification Process');
 'Form_Certification_Process_Basic-Info'.Updates;
 Form_Certification_Process_Work_Experience.Updates;
 Form_Certification_Process_Project_Completion.Updates;
 Form_Certification_Process_Project_Summaries.Updates
 );;
 Notify("Changes have been Saved";NotificationType.Success;2000);;
 );; //This should be the end of the DATA if Form Mode is new -
 
 //Else should follow 
 Patch(
 'Certification Process';
 ThisItem;
 'Form_Certification_Process_Basic-Info'.Updates;
 Form_Certification_Process_Work_Experience.Updates;
 Form_Certification_Process_Project_Completion.Updates;
 Form_Certification_Process_Project_Summaries.Updates
 );
 Notify("Changes have been Saved";NotificationType.Success;2000)
)

 

I want the second IF statement including the whole Content to be the action if Form Mode is new. 

In my code however the second Patch is being executed if the Form Mode is new as well - can anyone explain what point i am missing? 

Categories:
I have the same question (0)
  • Verified answer
    PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @Lephas,

     

    Please try the below code. I am not use to using ;; as we have , instead of ;; 

    If ('Form_Certification_Process_Basic-Info'.Mode = FormMode.New;
     If (IsBlank(Applied_Role_DataCardValue.Selected.Value);
     Notify("The Required Field 'Applied Role' under Basic-Info can't be empty"; NotificationType.Error;2000);
     Patch(
     'Certification Process';
     Defaults('Certification Process');
     'Form_Certification_Process_Basic-Info'.Updates;
     Form_Certification_Process_Work_Experience.Updates;
     Form_Certification_Process_Project_Completion.Updates;
     Form_Certification_Process_Project_Summaries.Updates
     );;
     Notify("Changes have been Saved";NotificationType.Success;2000);;
     ); //This should be the end of the DATA if Form Mode is new -
     
     //Else should follow 
     Patch(
     'Certification Process';
     ThisItem;
     'Form_Certification_Process_Basic-Info'.Updates;
     Form_Certification_Process_Work_Experience.Updates;
     Form_Certification_Process_Project_Completion.Updates;
     Form_Certification_Process_Project_Summaries.Updates
     );;
     Notify("Changes have been Saved";NotificationType.Success;2000)
    )

     

  • Lephas Profile Picture
    65 on at

    Thank you so much - you saved me from a big headache! I assume this semicolumn syntax is because my Power Apps is in German?

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    @Lephas 

     

    Welcome!

    Ahh yes German PowerApps has semicolon syntax

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard