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

Can I utilize the On Select function do display Text?

Hello

 

Can I utilize the OnSelect function to display Text on the screen. If so can you share the function?

 

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions

To have the box start off invisible and show up on button press:

 

1. Create the Text box as a label.

2. Insert the name in the text box

3. Selected the text box and set upper left to "Visible" and the function is as follows: 

If(VisibleVar=true,true,false)

4. Select the screen and then change the upper left to "OnVisibile" and the function is as follows:

UpdateContext({VisibleVar:false})

5. Select the Button and change the upper left to OnSelect: 

UpdateContext({VisibleVar:true})

6. Navigate away from the screen and back. Upon being visible it will set the VisibleVar to false, leaving your text box hidden. Pressing the button will then change VisibleVar to true showing the text box. 

 

To make the box visible on screen load and then disappear on click simply reverse the #3 step true/false

If(VisibleVar=true,false,true)

(or reverse on-load to false and onselect to true, your choice)

 

 

View solution in original post

Sure, just make more variables to keep track of more visible states.

 

VisibleVar1, VisibleVar2, etc.

 

In your On Visible make sure all of them are changed to false:

UpdateContext({VisibleVar1:false, VisibleVar2:false})

View solution in original post

9 REPLIES 9
Helper I
Helper I

Hello

 

Can I utilize the OnSelect function to display Text on the screen. If so can you share the function?

 

Thanks

Community Support
Community Support

Hi EVBII,

 

What’s your scenario? Could you show me more details about your scenario?


To display text on a screen, we should have a Label or a Text input box on the screen.


If you want to use OnSelect property to display text on a screen, please try to use UpdateContext function.


You could configure a Button’s OnSelect= UpdateContext({test:"show text"})


Then add a Label control, set its Text property=test.


Then when you click the button, the text would be shown on the label on the screen.


Please feel free reply if you need more help.

 

Best regards,
Mabel Mao

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

I am using asimple solution to show text that show/hides the text until a variable has changed.

 

In a text box on my screen with the text I want to show/hide in Visible I have : 

If(VisibleVar=true,true,false)

 

Then in the screen onvisible I have the variable set to true or false with: 

UpdateContext({VisibleVar:true})

 This allows for the initial state when viewing the screen to be set to true or false.

 

 

Then in the button onselect I have the variable update to false or true: 

UpdateContext({VisibleVar:false})

 

You can always flip the initial state around to hide or show it initially and then hide or show on button press.

 

 

There is another trick where you set the variable to !VisibleVar and it will flip states from false to true on click.

UpdateContext({VisibleVar:!VisibleVar})

Helpful if you want to change the state of an item to true false on click but not have an more complicated If statement.

 

 

 

 

Thank you for your reply;  I have followed your steps as follows please correct my error.

 

1. I created the Text box as a label.

2. I inserted the name I wanted in the text box

3. I selected the text box and set upper left to "Visible" and the function is as follows: If(VisibleVar=true,true,false)

4. The Text box then disappears

5. Next I select the screen and then change the upper left to "OnVisibile" and the function is as follows:

UpdateContext({VisibleVar:true})

6. Finally, I select the Icon or Button I inserted and change the upper left to OnSelect:

UpdateContext({VisibleVar:false})

 

At this point there appears to be no function.  What I am trying to do is place an arrow (icon) on an image.  With the selection of that arrow I would like to have a text/label box appear describing what the arrow is pointing at.  Do the steps above help with that?

 

Thanks again

I think you need to reverse your OnVisible to false first, that way you start with the text label visible false (based on your If statement)

 

 

Then in your OnSelect of the arrow change the variable to true, which will make the text label then true (based on if statment)

 

 

 

Hello,

 

Can you please go step by step as I did in my response.  There is a breakdown in the process.  I have switched the variables based on the If statement without results.

Can you correct where things went wrong below?:

 

1. I created the Text box as a label.

2. I inserted the name I wanted in the text box

3. I selected the text box and set upper left to "Visible" and the function is as follows: If(VisibleVar=true,true,false)

4. The Text box then disappears

5. Next I select the screen and then change the upper left to "OnVisibile" and the function is as follows:

UpdateContext({VisibleVar:true})

6. Finally, I select the Icon or Button I inserted and change the upper left to OnSelect:

UpdateContext({VisibleVar:false})

 

Thanks

 

To have the box start off invisible and show up on button press:

 

1. Create the Text box as a label.

2. Insert the name in the text box

3. Selected the text box and set upper left to "Visible" and the function is as follows: 

If(VisibleVar=true,true,false)

4. Select the screen and then change the upper left to "OnVisibile" and the function is as follows:

UpdateContext({VisibleVar:false})

5. Select the Button and change the upper left to OnSelect: 

UpdateContext({VisibleVar:true})

6. Navigate away from the screen and back. Upon being visible it will set the VisibleVar to false, leaving your text box hidden. Pressing the button will then change VisibleVar to true showing the text box. 

 

To make the box visible on screen load and then disappear on click simply reverse the #3 step true/false

If(VisibleVar=true,false,true)

(or reverse on-load to false and onselect to true, your choice)

 

 

View solution in original post

This worked Perfectly Thanks!

 

If I wanted to put multiple arrows each paired with a different label, would that be possible?

 

I have an image that I am trying to have the label appear at several different locations when the paired arrow is selected.  Sorry for all of the complexicity.

 

Thanks again

 

Ed

Sure, just make more variables to keep track of more visible states.

 

VisibleVar1, VisibleVar2, etc.

 

In your On Visible make sure all of them are changed to false:

UpdateContext({VisibleVar1:false, VisibleVar2:false})

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,017)