cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Courtney
Helper V
Helper V

override IF statement with an ONSELECT function?

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! 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
EricLott
Super User
Super User

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

 

 

 

 

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. 

v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Perfect, thank you! 

@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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (51,831)