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 / override IF statement ...
Power Apps
Answered

override IF statement with an ONSELECT function?

(0) ShareShare
ReportReport
Posted on by 261

I have a text entry box that will only show up when specific IF conditions are met.

 

What I need is for the user to then close the box down using the a ONSELECT function for an icon with out the required conditions being changed. 

 

The IF statement sits in the (visible) section so i cant seem to rename it and do do it that way which i know already works. 

Please see what I have done so far:

If(RandomLetter1MS.Text = "F", true, false) Or If(RandomLetter2MS.Text = "F", true, false) Or If(RandomLetter3MS.Text = "F", true, false) Or If(AreaFConfirm.Icon ="OnSelect", true)

The last If(AreaFConfirm.Icon="Onselect",true) didn't work when I selected the Icon. Everything else is fine. Any help would be much appreciated! 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    On the icon's OnSelect property, add this formula

     

    Set(Override, true)

     

     

    Then you can use this logic in your Visible property. No need for an if statement if you're going to return true in a true case.

     

    RandomLetter1MS.Text = "F" || RandomLetter2MS.Text = "F" || RandomLetter3MS.Text = "F" || Override

     

     

     

     

  • Courtney Profile Picture
    261 on at

    Thanks for getting back to me, I tried but it still doesn't seem to be working. The formula is accepted but when the random letter returns anything other than F the text entry box remains. The on select formula is accepted but makes no change either. Perhaps i'm missing something. 

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Courtney ,

    Could you please share a bit more about your scenario?

    Do you only want to display the Text Box when the "F" text is entered in RandomLetter1MS or RandomLetter2MS or RandomLetter3MS?

     

    Based on the needs that you mentioned, I think there is somethong wrong with your formula. I have made a test on my side, please consider take a try with the following workaround:

    Set the OnVisible property of current screen to following:

    Set(CloseClick, false)

    Set the OnSelect property of the Icon to following:

    Set(CloseClick, true)
    

    Set the Visible property of the Text Box to following:

    If(
     (RandomLetter1MS.Text = "F" || RandomLetter2MS.Text = "F" || RandomLetter3MS.Text = "F") && CloseClick = false,
     true,
     false
    )

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Courtney Profile Picture
    261 on at

    Perfect, thank you! 

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    @Courtney ,

    Have you solved your problem?

     

    If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

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
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard