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 / Checking several condi...
Power Apps
Unanswered

Checking several conditions using multiple If statements

(0) ShareShare
ReportReport
Posted on by 220

Hello, 

I have a situation where I have an IF Statement that checks a condition.  And that statement works but I also need to include another IF statement that will append to that the first IF statement.

First statement:

Comments: If(JobCode_x003a_PLine.Value="Wireline", "DR, Tier 1", "DR, Tier 1, MSK")

 

In the second statement I want to check the date and if it's a stat, I want the word, ", Stat" after the first statement result.

If(DataCardValue12_3.SelectedDate in DayCalendar.Event, ", Stat")

 

I tried to use an AND IF, but ended up with the word false being saved in my comments field.

 

Thanks for your help!

Categories:
I have the same question (0)
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Try something like this:

     

    If(
    JobCode_x003a_PLine.Value="Wireline" && DataCardValue12_3.SelectedDate in DayCalendar.Event, "DR, Tier 1", "DR, Tier 1, MSK, Stat", 
    JobCode_x003a_PLine.Value="Wireline"&& !(DataCardValue12_3.SelectedDate in DayCalendar.Event), "DR, Tier 1", "DR, Tier 1, MSK")
    
    
    
    
  • TB-20081424-0 Profile Picture
    220 on at

    When I submit, the comment is not saving, it is blank.  

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    I see what the issue is.  Let me clarify one thing.   On the second comparison does it matter if the first value equals Wireline or not?

  • TB-20081424-0 Profile Picture
    220 on at

    I want to check if a value is wireline and if so display "DR, Tier 1"  and if day is a stat, I want to include ", Stat"; otherwise leave ",Stat" out.

    If the value is not wireline, I want "DR, Tier 1, MSK", and if day is stat, I want to include ",Stat", otherwise leave, ",Stat" out.

  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Try something like this.  Put your most complex conditions at the top and go from there.   Once it matches a specified set of conditions it stops evaluating and returns the result.

     

     

    If(
    JobCode_x003a_PLine.Value="Wireline" && DataCardValue12_3.SelectedDate in DayCalendar.Event, "DR, Tier 1, Stat", , 
    JobCode_x003a_PLine.Value="Wireline", "DR, Tier 1",
    DataCardValue12_3.SelectedDate in DayCalendar.Event,"DR, Tier 1, MSK, Stat",
    "DR, Tier 1, MSK"
    )
    

     

     

  • TB-20081424-0 Profile Picture
    220 on at

    Thank you for your quick response and support in helping me solve my issue!  

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