cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EVBII
Level: Powered On

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
JRaasumaa
Level 10

Re: Can I utilize the On Select function do display Text?

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

JRaasumaa
Level 10

Re: Can I utilize the On Select function do display Text?

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
EVBII
Level: Powered On

Can I utilize the On Select function to display Text?

Hello

 

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

 

Thanks

Community Support Team
Community Support Team

Re: Can I utilize the On Select function do display Text?

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.
JRaasumaa
Level 10

Re: Can I utilize the On Select function do display Text?

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.

 

 

 

 

EVBII
Level: Powered On

Re: Can I utilize the On Select function do display Text?

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

JRaasumaa
Level 10

Re: Can I utilize the On Select function do display Text?

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)

 

 

 

EVBII
Level: Powered On

Re: Can I utilize the On Select function do display Text?

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

 

JRaasumaa
Level 10

Re: Can I utilize the On Select function do display Text?

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

EVBII
Level: Powered On

Re: Can I utilize the On Select function do display Text?

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

JRaasumaa
Level 10

Re: Can I utilize the On Select function do display Text?

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 347 members 6,851 guests
Recent signins:
Please welcome our newest community members: