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 / Update SQL using Colle...
Power Apps
Answered

Update SQL using Collection

(0) ShareShare
ReportReport
Posted on by 42

As part of the OnVisible property of a screen i am loading data into a Collection.

Then i use a Gallery to edit the Collection.

Finally i use the following formula to update a SQL table using the data from the Collection:

ForAll(TempCollect1,Patch(First(Filter('[dbo].[TurnaroundTimeProductMap]', Id=TTPMId)),{ProductQuantity:TTPMProductQuantity}))

 

The formula shows no error but the data in the SQL table is not updated. If i go File then Colllections, i can see that the Collection is being updated. Does anyone have any ideas?

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

    Hi @ryang ,

     

    Check on below documentation about how to bulk update records with gallery:

    https://powerapps.microsoft.com/ja-jp/blog/bulk-update-using-forall-and-patch/

     

    Regards,

    Mona

  • ryang Profile Picture
    42 on at

    In reviewing the documentation, it became apparent i made an error in my formula.

    ForAll(TempCollect1,Patch(First(Filter('[dbo].[TurnaroundTimeProductMap]', Id=TTPMId)),{ProductQuantity:TTPMProductQuantity})) - my original formula

    ForAll(TempCollect1,Patch('[dbo].[TurnaroundTimeProductMap]',First(Filter('[dbo].[TurnaroundTimeProductMap]', Id=TTPMId)),{ProductQuantity:TTPMProductQuantity})) - highlighted is my missing parameter.

    For someone who uses Patch to write and update to SQL tables as often as i do, cant beleive i made this mistake

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard