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 / Patch and SQL Server
Power Apps
Answered

Patch and SQL Server

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

Im trying to update a record in a SQLServer Table.
The connection is ok, My table has id as primaryID 
All fields visible in powerapps.

 

I have created a gallery witch displays the records in the DB.
And here is the problem:

I have added a button under the datacard and added this under onselect:

Patch('[dbo].[Befaring]';First(Filter('[dbo].[Befaring]';id=BrowseGallery1_1.Selected.id));{Utfort: "Ja"})

The semicolons(separators) are used in Norwegian version of powerapps instead of comma

As you can see im trying to update record Utfort with the text Ja

This doesnt work. Any ideas???

Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @Anonymous 

    There was a very similar post about this yesterday here.

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-Function-Doesn-t-update-the-SQL/m-p/438328/highlight/false#M129906 

    I would try the same suggestions that I suggested in that post. That is, to check that First/Filter function returns the expected record by using a label, and to try the LookUp function instead.

    Feel free to post back here if you require any clarification.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

    Thank you for your answer!!

     

    I added a new textbox outside the gallery an wrote this in default:
    LookUp('[dbo].[Befaring]';id=3).Navn

    This returned the name (Navn) of the customer.

     

    Then i added a new button inside the datacard(To see if there was a bug in the old one) and added this into onselect:
    Patch('[dbo].[Befaring]';LookUp('[dbo].[Befaring]';id=2);{Utfort: "Ja"})
    Didnt work. I hardcoded to update id 2

     

    Server response is: Resource not found

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Solved it.
    When you update the database with primary key. It doesnt help just to click opdate on the connection.
    You have to remove it and add it again and then it works.

     

    Perfekt

  • bepads Profile Picture
    5 on at

    Also worked for me. Refresh the source seems not work.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard