cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Change label when focus changes

Hey,

 

I have a screen with a form and a label. On that form there are several controls (text input, date input, combobox). With hitting 'Tab', users can go from one control to the other. 

I want to change the text from the label when the focus changes. So by tapping through the datacards, the label changes.

 

I tried the OnSelect-function but that works only if the user clicks on the controls, not with tab.

 

Any suggestions?

 

Thanks in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions

@Verlet 

Sorry, but this is not possible in PowerApps

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

5 REPLIES 5
Super User III
Super User III

@Verlet 
You'll want to use the OnChange property instead.  

I'll assume your label holds a SET variable and you want to have it updated when switching fields.  Put this code in the OnChange property of each control (text input, date input, combobox).

Set(varYourVariable, your_code_here)


Then put this code in the Text property of the label

varYourVariable



---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaney , thank you for the reply, but that is not the wanted solution.

 

If you use the OnChange property it changes the label after the text has changed and if you switch fields.

 

The goal is to see different text in the label when the user put the focus on the control. The label acts this way as a kind of tooltip, but without the mouse-hovering. So if you press 'Tab' you go to the textbox in DataCard2 and you see some extra info in the label about what is needed in that textbox. The infotext is too big for tooltip or hinttext.

 

In the attached example: focus was put in form 1 on textbox 2 now (after putting text in text1). So now I want to see more info about what to put in textbox 2, shown in the label on the right hand side.

@Verlet 

Sorry, but this is not possible in PowerApps

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Strange, because Power Apps knows where the focus is (as it changes the border) but I understand as a developer we can not find where the focus is set or if an element has focus or not? 

Thank you for your effort and reply's @mdevaney !

@Verlet 
If I answered your question, please close the thread.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (109,150)