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 / How to update database...
Power Apps
Answered

How to update database record from text input values

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi -  I have a screen with one drop down button and multiple text fields (say 6). When a drop down value is chosen, text fields will be auto populated and the user can update any of these text fields. this is all working fine. But I do not know how to update this particular record in data source table. I am not using form, the drop down and text input values are just on the screen.

Categories:
  • SkiDK Profile Picture
    1,016 on at

    Hi @Anonymous 

     

    You can use the Patch function for this: Patch function in Power Apps (contains video) - Power Apps | Microsoft Docs

     

    Patch(
     dbList,
     LookUp(dbList, ID = 1), //finding the record to update
     {
     Field1 = textinput1.Text,
     Field2 = dropdown.Selected.Value,
     ...
     }
    );

    Adding a new record in the db:

    Patch(
     dbList,
     Defaults(dbList),
     {
     Field1 = textinput1.Text,
     Field2 = dropdown.Selected.Value,
     ...
     }
    );

     

    Hope this helps!

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @SkiDK  -  Inserting new record worked with Patch. But I need to update existing record.

    But I am getting error when trying to update existing record. here is what I am doing -

     

    Patch(table1,LookUp(table1,'Content.InvoiceId'= Dropdown2.Selected.'Content.InvoiceId')
    {
    'Content.Customer':TextInput1.Text,
    'Content.Owner':TextInput2.Text,
    'Content.Vendor':TextInput3.Text,
    'Content.PurchaseOrderId':TextInput4.Text,
    'Content.InvoiceDate':TextInput5.Text

    }
    ) ;

     

     

    Error I am getting -

    error.JPG

  • WarrenBelz Profile Picture
    156,730 Most Valuable Professional on at

    @Anonymous ,

    You have two threads going on the same issue - I responded to the other one here

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

    The below worked for me when I used either dropdown or combo box -

    Patch( ConsumerList,

    LookUp(ConsumerList,'Content.InvoiceId'=ComboBox1.Selected.'Content.InvoiceId'),

    {'Content.Customer':TextInput1_1.Text,'Content.Owner':TextInput2_1.Text,'Content.Vendor':TextInput3_1.Text,

    'Content.PurchaseOrderId':TextInput4_1.Text,'Content.InvoiceDate':TextInput5_1.Text});

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