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.
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!
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?
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 } ) )
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional