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 statement skipping ...
Power Apps
Answered

If statement skipping over true value

(0) ShareShare
ReportReport
Posted on by 6

I have a combobox and an input field. I'm trying to use an if function to give different outcomes depending on what gets entered and if they match or not. 

 

 

//set input variables
Set(varSelectedIDOut, Text(searchCheckOut.Selected.ID));
Set(varInputIDOut, inputIDOut.Text);

If( 
 //error: both inputs blank
 IsBlank(varSelectedIDOut) && IsBlank(varInputIDOut), 
 Notify("both empty");

 //error: no name selected
 IsBlank(varSelectedIDOut), 
 Notify("no name");

 //error: no id input
 IsBlank(varInputIDOut),
 Notify("no id");
 
 //error: selected name id and input id don't match
 varSelectedIDOut <> varInputIDOut,
 Notify("don't match");

 //success 
 varSelectedIDOut = varInputIDOut, 
 Notify("yay");

);

Reset([@searchCheckOut]);

 

 

Everything is working except the no name error. Even though it does mark IsBlank(varSelectedIDOut) as true, it gives me the "don't match" notification instead of "no name". I cannot for the life of me figure out why. 

 

Any help would be greatly appreciated!

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @96skittles 

    You are using semicolons rather than commas in your formula to delimit the If clause, this is not going to evaluate the way you expect.

    Please consider changing your Formula to the following:

    //set input variables
    Set(varSelectedIDOut, Text(searchCheckOut.Selected.ID));
    Set(varInputIDOut, inputIDOut.Text);
    
    If( 
     //error: both inputs blank
     IsBlank(varSelectedIDOut) && IsBlank(varInputIDOut), 
     Notify("both empty"),
     
     //error: no name selected
     IsBlank(varSelectedIDOut), 
     Notify("no name"),
    
     //error: no id input
     IsBlank(varInputIDOut),
     Notify("no id"),
     
     //error: selected name id and input id don't match
     varSelectedIDOut <> varInputIDOut,
     Notify("don't match"),
    
     //success 
     varSelectedIDOut = varInputIDOut, 
     Notify("yay")
    
    );
    
    Reset([@searchCheckOut]);

     

    I hope this is helpful for you.

  • 96skittles Profile Picture
    6 on at

    Yup that worked. I'm not used to the powerapps syntax yet. Thanks!! 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard