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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / OnChange not firing
Power Apps
Unanswered

OnChange not firing

(0) ShareShare
ReportReport
Posted on by 364

Hi there,

 

I have an OnChange function on a text input (# Students) that is designed to update all records in a gallery (# Stud.) when the number is changed. While i was using a SharePoint list as my database, it worked great, but now that I've moved over to an SQL DB, it doesn't seem to be firing when changed.

 

Capture

 

UpdateContext(
 {newStudents:
 'UE - Value - # Students'.Text}
);
ForAll(
 'UE Unit Gal'.AllItems,
 Patch(
 '[dbo].[Units]',
 LookUp(
 '[dbo].[Units]',
 ID = Value('UE Gal ID'.Text)
 ),
 {
 'Number_x0020_of_x0020_Students': Value(newStudents)
 }
 )
)

The offending input is the one with the delegation error. If anyone can help me remove that as well, I'd be very grateful! 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @EpicTriffid 

     

    Can you try to update the expression as:

    UpdateContext(
        {newStudents:
        Value('UE - Value - # Students'.Text)}
    );
    ForAll(
        'UE Unit Gal'.AllItems,
        Patch(
            '[dbo].[Units]',
            LookUp(
                '[dbo].[Units]',
                ID = Value('UE Gal ID'.Text)
            ),
            {
                'Number_x0020_of_x0020_Students': newStudents
            }
        )
    )
    Are you getting any errors? To check if the OnChange is getting triggered, add the below expression on the OnChange property as:
    Notify("Getting triggered");
    If you are able to see the notification, then the issue is with the Patch query and OnChange is getting triggered.
     
    Note: OnChange only gets triggered if the user clicks outside the text input. 
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • EpicTriffid Profile Picture
    364 on at

    Hi @yashag2255 ,

     

    Thanks for the help. I adapted it as you said, and no errors that I can see. The notifation does come through, so do you have ideas what might be wrong with the Patch? Is there a problem between ForAll and SQL?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard