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 update record no...
Power Apps
Answered

Patch update record not working

(1) ShareShare
ReportReport
Posted on by 143

Hello everyone,

 

I'm having trouble testing out using Patch to update a record on a SharePoint list called Bid Log Book. I have an edit form that I have that is tied to a BrowseGallery1.Selected. My Save button has the following command in the On Select trigger:

Patch('Bid Log Book',BrowseGallery1.Selected,{Title: DateReceived,IFB_x0020_x0023: IFBNum})

 

I also tried this variation:

 

Patch('Bid Log Book',First(Filter('Bid Log Book', ID = BrowseGallery1.Selected.ID)),{Title: DateReceived,IFB_x0020_x0023_: IFBNum})

 

It's a simple Patch command that I will build on to include the other fields but I want to get it working first. When I run and click the Save button nothing happens. No errors or any indication (walking dots at the top of the form) that it is trying to save to the SharePoint. Let me know if additional details are needed to help explain the application setup.

 

Any suggestions would be appreciated.

 

Ray

Categories:
  • murali Profile Picture
    Microsoft Employee on at

    Sorry to hear that. 

     

    Can you capture a screenshot after you clicked on Save and attach here? It will be helpful.

     

    I assume you have added 'Bid Log Book'. Are you not seeing any errors on the OnSelect trigger? What does 'Bid Log Book' look like?

     

    Thanks

    Murali

  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi Ray,

     

    I have a SharePoint list named as CustomList, in which there are Fname and Lname columns. I create an App from blank, add two screens on the App.
    On screen1, add a gallery, set its Items property as CustomList, add a Next arrow navigate to screen2.
    On screen2, add an edit form, set its Data source as CustomList, Items property as Gallery1.Selected. Add a button, and set its Onselect property as:

    Patch('Custom list',First(Filter('Custom list',ID=Gallery1.Selected.ID)),{Fname:"TestF",Lname:"TestL"})

     

    Then when I click the button, the selected value would be updated, both in the App and SharePoint list. This function works for me.

     

    Please check this part in your function, a Text value is being asked, but I don’t know how are the values “DateReceived” and “IFBNum” configured. Could you try to add a double quotation mark to see if it works?
    {Title: DateReceived,IFB_x0020_x0023_: IFBNum})


    Best regards,
    Mabel Mao

  • Ray_Garza Profile Picture
    143 on at

    Hello Murali,

     

    I found a partial solution to my problem. The Date Received on the form was via a Date picker but on SharePoint it is defined as a single line of text. I changed the field in the app from a Date Picker to Text Input and changed the Patch command to: Date_x0020_Received: DateReceived.Text and that seemed to work for updating that field.

     

    The problem now is that the IFB # is also a single line of text in SharePoint and when I update the Patch to append the .TEXT to the field it then complains that the field IFB_x0020_x0023_ does not exist. If I leave out the .TEXT it accecpts the name but will not update the data.

     

    Here are screen captures of the SharePoint List and the Application layout:

    Sharepoint List.pngPowerApp.png

     

  • Ray_Garza Profile Picture
    143 on at

    Hi Mabel,

     

    Thanks for your reply, I think I figured out most of the problem. I'm not using a form but rather just manually building the page layout to my liking. I figured out that appending the ".TEXT" to the end of the feild name works except for the one issue of the IFB number. Both IFB # and the Date Received are Single Line Text fields in SharePoint but only the Date Received is working. For some reason when I append the ".TEXT" to the field for the IFB number it says that my field cannot be found in the SharePoint list. 

     

    IFB_x0020_x0023_:IFBNum.TEXTIFB_x0020_x0023_ can't be found in the SharePoint List

    IFB_x0020_x0023_:IFBNum = no errors but will not update the SharePoint list

  • Verified answer
    Ray_Garza Profile Picture
    143 on at

    Ok I figured out the last remaning issue with Patch

     

    IFB_x0020_x0023_:IFBNum.TEXTIFB_x0020_x0023_ can't be found in the SharePoint List

    IFB_x0020_x0023_:IFBNum = no errors but will not update the SharePoint list

     

    It looks like it didn't like the "#" in the SharePoint column name of IFB #. I tried renaming it from IFB # to IFB Number but that had no affect. I created a new column called IFB Number and set it as a single line of text. Went back to the app and refreshed the connection. Updated the field in the form to the new column (IFB_x0020_Number) and updated the Patch to IFB_x0020_Number:IFBNum.Text and it now works.

     

    Now I wish I could drop down to SQL and copy the contents from IFB # to IFB Number.

     

    Thanks everyone for your help in bringing up ideas and memory jogs.

  • Paul_GP Profile Picture
    17 on at

    Thanks for this,

     

    Helped me solve a similar problem i was having!

  • sai1 Profile Picture
    4 on at

    Hello,

     

    I'm having a similar problem. I am using powerBI data and try to insert that in to a table in SQL database. Here is my patch statement. My goal is to load some rows in to SQL.

     

    Patch('[dbo].[Powerapp]',Gallery1.Selected,{ContractGroup:'ContractGroup',Description:'Description',Current_x0020_Total_x0020_Charges:'Current Total Charges',HS_x0020_ZBA_x0020_Contractual_x0020_Adjustment_x0020_Rate:'HS ZBA Contractual Adjustment Rate',Additional_x0020_Total_x0020_Rate:'Additional Total Rate',HS_x0020_ZBA_x0020_Bad_x0020_Debt_x0020_Adjustments_x0020_Rate:'HS ZBA Bad Debt Adjustment Rate',HS_x0020_ZBA_x0020_OtherAdjustment_x0020_Rate:'HS ZBA OtherAdjustment Rate',NPSR_x0020_Additional_x0020_Reserve:'NPSR Additional Reserve',NPSR_x0020_Bad_x0020_Debt_x0020_Adjustments_x0020_Reserve:'NPSR Bad Debt Adjustments Reserve',NPSR_x0020_Contractual_x0020_Adjustments_x0020_Reserve:'NPSR Contractual Adjustments Reserve',NPSR_x0020_Net:'NPSR Net',NPSR_x0020_Net_x0025_:'NPSR Net %',NPSR_x0020_Other_x0020_Adjustments_x0020_Reserve:'NPSR Other Adjustments Reserve'})

    It says patch statement had some invalid arguements. Any help on this is appreciated.

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard