web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Understanding the logi...
Power Apps
Answered

Understanding the logic of OnChange

(0) ShareShare
ReportReport
Posted on by 8

Can someone explain this to me? I'm trying to understand the logic of Onchange when it is supposed to fire or not.

This is supposed to give the same result.. right?

let's say I have 2 controls a label1 and a slider1.

If I go to the OnChange property of Slider1 and put "label1.text=text(slider1.value)" .. it should give the 'same' result as if I would have gone in the text property of Label1 and added "text(slider1.Value)" right?

meaning if I change the slider, the onchange should trigger and change the text of the label? (I know it's better to add this immediatly in the text property of that label) But I'm trying to understand the logic here as the OnChange property doesn't seem to do anything.. I thought i was on a good way of understanding Power apps.. but now i'm feeling a bit lost as to why the onchange isn't triggering or doing anything in this case.

Thanks for your help!

Categories:
I have the same question (0)
  • Verified answer
    v-mengmli-msft Profile Picture
    on at

    Hi @NathanArch ,

     

    For OnChange of controls, it means formula will run when value of control is changed.

    For example, we can use Set, Patch, Clear on OnChange property to update variables or collection.

    The formula you are using just returns true/false, it doesn't do anything like Set or Patch function.

     

    Best regards,

    Rimmon

  • NathanArch Profile Picture
    8 on at

    I see, this clears a lot up for me.. was indeed a stupid question, thanks for your clear and swift reply.. much appreciated

  • NathanArch Profile Picture
    8 on at

    @v-mengmli-msft  One more question,

    I tried to do as you explained; I created a variable by adding on Onstart : Set(LabelText,label1.text)


    Then on the slider1 OnChange property I added : Set(Labeltext,text(Slider1.value))

    when i change the slider.. nothing seems to be happening, could you guide me as to why it would not be triggering or changing the label text property?

    thanks again for all your help

  • NathanArch Profile Picture
    8 on at

    Nevermind ,i got the solution.. 

    I should just add my variable to the text property of that label..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard