cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ray_Garza
Advocate III
Advocate III

Patch update record not working

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

7 REPLIES 7
murali
Power Apps
Power Apps

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
Community Support
Community Support

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

 

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

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.

View solution in original post

Paul_GP
Frequent Visitor

Thanks for this,

 

Helped me solve a similar problem i was having!

sai1
Frequent Visitor

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.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,732)