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 / OnChange Label is not ...
Power Apps
Answered

OnChange Label is not updating when value changes

(0) ShareShare
ReportReport
Posted on by 214

Got a good one this morning which I thought was already solved. 

I have a label that shows the number of days an item has been in inventory.

The Default is set to as shown below, for calculating the number of Days since the item was checked in

DateDiff(ThisItem.CheckInDate,Today())

LyonsBI_BRL_0-1620405036573.png

However on the OnChange, whenever the value changes, it's not posting back to the DB. I'm sure its something I'm overlooking here. Any help would be appreciated. 

Patch('Customers',ThisItem,{CountDays:NumberofDays.Text})

 

Thanks!

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @LyonsBI_BRL 

    Please consider changing your Formula to the following:

    UpdateIf('Customers',ID = ThisItem.ID, {CountDays:NumberofDays.Text})

    If your CountDays column is a numeric column, then change to:

    UpdateIf('Customers',ID = ThisItem.ID, {CountDays: Value(NumberofDays.Text)})

     

    I hope this is helpful for you.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @LyonsBI_BRL,

    Based on the issue that you mentioned, do you want to update the CountDays based on the Text input on change?

    Could you please share a bit more about the scenario?

    Your formula is completely correct, this should work if the OnChange fires.

    Actually, the OnChange property will be triggered only when the user clicks on anywhere of the screen, and not as soon as the condition is met.

    OnChange â€“ How the app responds when the user changes the value of a control (for example, by adjusting a slider).

    This is how our official doc defines the OnChange property.

    I have make a test for you, please check as below.

    Reset.gif

    You could see that you need to click other place within the Screen to trigger to OnChange property.

    As an alternative solution, please consider inset a submit button to trigger the Patch().

    Insert a button into the Gallery, set the OnSelect as below:

    Patch('Customers',ThisItem,{CountDays:NumberofDays.Text})

    Regards,

    Qi

  • LyonsBI_BRL Profile Picture
    214 on at

    @v-qiaqi-msft yeah I figured that one out 😀

     

    Thanks!

  • MustafaHussain Profile Picture
    173 on at

    Hi @RandyHayes  @v-qiaqi-msft 
    I need a little bit help on this
    As I have a Text Input and I am showing an ID Number ( which is getting from a Variable) and the control is read only mode.

    when I save it's not saving that ID number into my Text Column. 

    MY TextInput OnChange.. (its not storing it ) how can I tell the app that the value is changed


    I have used this OnChange of the Text Input

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard