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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

Patch Function

(0) ShareShare
ReportReport
Posted on by 640

Hello People,

 

I am trying to update a row in the SQL Server. In powerapps I have a data table to show available entries in the database. Also, I have form editor to allow users to update the record for a selected row from data table.

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @omi18 

    Since you already have an edit form could you use the SUBMIT function instead of PATCH?

     

    Try this code in the OnSelect property of a button.

    Submit(your_form_name);

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @omi18 ,

    Do you want to update the selected record in your Data Table using Edit form?

     

    Please consider take a try with the following workaround:

    Set the Items property of the Data Table to following:

     

    '[dbo].[SQLTable]'

     

     

    Set the DataSource property of the Edit form to following:

     

    '[dbo].[SQLTable]'

     

    set the Item property of the Edit form to following:

     

    DataTable1.Selected

     

    or

     

    LookUp('[dbo].[SQLTable]', PrimaryKeyColumn = DataTable1.Selected.PrimaryKeyColumn)

     

    Set the DefaultMode property of the Edit form to following:

     

    FormMode.Edit

     

     

    Set the OnSelect property of the "Submit" button to following:

     

    SubmitForm(EditForm1)

     

    Note: Please make sure you have specified a proper Primary Key within your SQL Table.

     

    If you want to use Patch function to submit your data to your SQL Table, please modify the submission formula as below (set the OnSelect property of "Submit" button to following😞

    Patch(
     '[dbo].[SQLTable]',
     DataTable1.Selected,
     EditForm1.Updates
    )

     

    Best regards,

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard