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 / Insert/Update data fro...
Power Apps
Answered

Insert/Update data from PowerApps to SQL table

(0) ShareShare
ReportReport
Posted on by 29

Hi,

I am new to PowerApps. 

I am developing a Canvas app to insert/update data to SQL server database. For which I create an edit Gallery view to allow the users to make changes , create a collection to capture changes and try to patch it to the database.

I struck with an error " Network Error when using Patch function".

FYI- using Forms I can update the data in database using SubmitForm,(so I have appropriate access to the DB) but the requirement is to update multiple records together.

 

Thanks in advance for any suggestions/help.

Error1.PNGError2.PNG

 

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @prabakar21 , Please share the code also. Ideally the code should look like this:

    ForAll(collection As var,
     Patch(DataSource, 
     LookUp(DataSource, ID = var.ID),
     {
     column1: var.column1,
     column2: var.column2
     }
     )
    )
    

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • prabakar21 Profile Picture
    29 on at

    Hi @ANB ,

    Thanks for your quick reply. 

     

    Still no luck. Attaching the file. Can you please check. 

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @prabakar21, I would request you to send the screenshots of complete code, because I cannot import your app because I dont have SQL db to create connection.

     

    Thanks,

    ANB

  • prabakar21 Profile Picture
    29 on at

    Hi @ANB ,

     

    PFA the screenshots of the code

  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @prabakar21, Please check Reza's video which can help you: https://www.youtube.com/watch?v=8I0Pt_8I6k8&t=1295s

     

    The only thing is that he is using dataverse and you just need to use SQL as data source.

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Verified answer
    prabakar21 Profile Picture
    29 on at

    Thanks @ANB , Reza's video is quite handy. I can update the data now, thanks 

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

#2
11manish Profile Picture

11manish 180

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard