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 / If and else if statement
Power Apps
Unanswered

If and else if statement

(0) ShareShare
ReportReport
Posted on by 27

Hi, 

 

I want to submit a form once some conditions are met.   The first condition is to check the status (DataCardValue105). If status is "In progress", the form is submitted. If status is "Completed", some other condition apply - all mandatory fields should be filled in. If the mandatory fields are blank, a warning message should show up. 

 

I have tried this:

 

 

If(DataCardValue105.Selected.Value = "Completed" , If 
(DataCardValue79.SelectedDate = Blank() && DataCardValue80.Selected.Value = Blank() && 
DataCardValue81.Selected.Value = Blank() &&
DataCardValue82.Text = Blank() && 
DataCardValue83.Text = Blank() && 
DataCardValue84.Selected.Value = Blank() && 
DataCardValue85.Selected.Value = Blank() && 
DataCardValue86.Selected.Value = Blank() && 
DateValue5.SelectedDate = Blank() && 
DateValue6.SelectedDate= Blank(),
UpdateContext({textboxvisible:true}), SubmitForm(Form2)), SubmitForm(Form2));

 

 

 

Using this code, the form is submitted even though status is completed and mandatory fields are blank. 

 

Can anyone help me with this? 

Thank you

 

 

Categories:
I have the same question (0)
  • timl Profile Picture
    37,160 Super User 2026 Season 1 on at

    Hi @bsr1 

    If your actual intention is to test the entry of data based on an 'Or' condition, that would be one explaination as to why your forumula doesn't behave as expected (eg, dispaly the warning message if DataCardValue82.Text is blank OR DataCardValue83.Text is blank etc).

    In this case, you can change the && operator to the || operator.

    If(DataCardValue105.Selected.Value = "Completed" && 
    (DataCardValue79.SelectedDate = Blank() || DataCardValue80.Selected.Value = Blank() || 
    DataCardValue81.Selected.Value = Blank() ||
    DataCardValue82.Text = Blank() || 
    DataCardValue83.Text = Blank() || 
    DataCardValue84.Selected.Value = Blank() || 
    DataCardValue85.Selected.Value = Blank() || 
    DataCardValue86.Selected.Value = Blank() || 
    DateValue5.SelectedDate = Blank() || 
    DateValue6.SelectedDate= Blank()),
    UpdateContext({textboxvisible:true}), SubmitForm(Form2));
    
  • bsr1 Profile Picture
    27 on at

    Hi, 

     

    I have encountered an issue with the formula above.  It seems to work only when drop down Data Card is left in blank. When I leave a text Data Card Value blank, it is still possible to submit the form. How can I force that the Data Card Value Text should be filled in when status is Completed? 

     

     

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 638

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard