cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KimberlyM
Helper IV
Helper IV

Patching to 2nd SharePoint List

My Overall Goal:
I am trying to Patch "Notes" to my SharePoint List Lead_History.

My Process:
I have a main SharePoint list that contains all my Lead Data called Lead_Data but this list excludes my Lead_History (or notes) as there can be multiple entries per lead for this. 
I have a dashboard page that I click to display the Specfic Lead data which has a list at the bottom of all the history of notes. I want to be able from this same screen to be able to add to my history of notes.
I have added a textbox and I want to be able to patch this box by clicking on the + button rather than the checkmark in my top right corner. I want the user to see that the item is added to the gallery at the bottom of the screen.

The current code I have, that is not working is: 

Patch(Lead_History, Lead_History.LeadID = Gallery_Dashboard.Selected.ID, {Note: txt_HistoryDetail.Text, HistoryDate: Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss")});

It just keeps telling me there is an invalid argument but I have no idea what I am doing wrong. In my mind this should do what I want. 

 

Is anyone able to help me figure this out? I have a screen cap below to visualize what I am saying above.
Capture_edit2.JPG

13 REPLIES 13

What I am finding is it is just replacing the first item it finds with the ID number that is loaded so in this case ID number 54. It is not creating a row item.

cds
Impactful Individual
Impactful Individual

Patch(Datasource, Defaults(Datasource), {updates})

 

Defaults() will create a new item in list

View solution in original post

@cds Thank you for working through this with me. With everything we discussed and your amazing help and patience (Thank you is not enough!), I have it working! 

Patch(Lead_History, Defaults(Lead_History), {Title: "", Note: txt_HistoryDetail.Text, HistoryDate: Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss"), LeadID: Gallery_Dashboard.Selected.ID});

The key I was missing was to have the {updates} area also post the LeadID. 
So thank you again!

cds
Impactful Individual
Impactful Individual

vera nice 👌 glad I could help

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,605)