cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NigelP
Kudo Kingpin
Kudo Kingpin

How Can I find out when a Text Field (Label) changes

Hi 

 

I have a menu component that returns the selected item when a user selects an item in the menu.  The selected Item is put into a Label field on the screen. Set(gTemptext, MenuComponent.Selected.Item), the in the Label Field Default is gTempText.

 

How can I find out when the item has been selected ( and hence the contents of the Label field has changed) so I can initiate another action dependant upon the menu tem selected ?

Thanks

 

Nigel

 

Label does not have an OnChange Event / property which fires when the text in the label changes.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @NigelP ,

Do you want to detect if the Label value has been changed within your app?

 

Based on the needs that you mentioned, I think the Timer control could achieve your needs. I have made a test o n my side, please take a try with the following workaround:

Add a Timer control within your app, set the Duration property to following:

1000

Set the AutoStart property and Repeat property to following:

true

Set the OnTimerEnd property of the Timer control to following:

If(
   OldValue = Label1.Text,
   Set(OldValue, Label1.Text),
  'Type your Refresh formula here';Set(OldValue, Label1.Text)            /* <-- OldValue variabe value <> Label1.Text, your Refresh formula would be executed */
)

Set the Visible property of the Timer to following:

false         /* <-- Hide your Timer control */

Please take a try with above alternative solution, check if it could help in your scenario.

 

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

4 REPLIES 4
RezaDorrani
Dual Super User II
Dual Super User II

Hi @NigelP 

 

you would have to add that logic on the dependent action field

 

Example label will change based on selection made in component 

eg label - "red"    label - "blue"

 

and lets say you want to set color property for another field based on label changing

 

then on color porperty of other field use

 

If(Label = "red", Color.Red, If (Label= "blue", Color.Blue))

 

This is just an example

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi @RezaDorrani 

 

Thanks for the reply.

 

In my use case when the label field changes, I want to trigger a refresh of a query which (re)populates a collection.

 

Regards

 

Nigel 

Hi there,

 

If you want to refresh a query which populates a collection, and you are using this label field property, it should be done automatically. So, whenever the set property changes the query should be updates as well.

v-xida-msft
Community Support
Community Support

Hi @NigelP ,

Do you want to detect if the Label value has been changed within your app?

 

Based on the needs that you mentioned, I think the Timer control could achieve your needs. I have made a test o n my side, please take a try with the following workaround:

Add a Timer control within your app, set the Duration property to following:

1000

Set the AutoStart property and Repeat property to following:

true

Set the OnTimerEnd property of the Timer control to following:

If(
   OldValue = Label1.Text,
   Set(OldValue, Label1.Text),
  'Type your Refresh formula here';Set(OldValue, Label1.Text)            /* <-- OldValue variabe value <> Label1.Text, your Refresh formula would be executed */
)

Set the Visible property of the Timer to following:

false         /* <-- Hide your Timer control */

Please take a try with above alternative solution, check if it could help in your scenario.

 

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,841)