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

Community site session details

Session Id : Thfdbq3NZ+vvh5WyE6YQ7X
Power Apps - Building Power Apps
Answered

Patch update record not working

Like (1) ShareShare
ReportReport
Posted on 21 Nov 2016 18:31:24 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:
I have the same question (0)
  • sai1 Profile Picture
    4 on 20 Dec 2018 at 20:13:36
    Re: Patch update record not working For SQL

    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.

  • Paul_GP Profile Picture
    17 on 09 Mar 2018 at 17:35:11
    Re: Patch update record not working

    Thanks for this,

     

    Helped me solve a similar problem i was having!

  • Verified answer
    Ray_Garza Profile Picture
    143 on 22 Nov 2016 at 16:29:57
    Re: Patch update record not working

    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.

  • Ray_Garza Profile Picture
    143 on 22 Nov 2016 at 15:24:30
    Re: Patch update record not working

    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

  • Ray_Garza Profile Picture
    143 on 22 Nov 2016 at 15:12:37
    Re: Patch update record not working

    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

     

  • v-yamao-msft Profile Picture
    on 22 Nov 2016 at 06:57:00
    Re: Patch update record not working

    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

  • murali Profile Picture
    on 22 Nov 2016 at 01:38:42
    Re: Patch update record not working

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete