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

Submit to One Sharepoint List and Patch to Another and Link them Through ID Number

I have two sharepoint lists:
1. Main Data called Lead_Data and
2. Lead_History.

I am trying to post a timestamp to lead history when I create a new record in Lead_Data. The new record in Lead_Data is created when I submit my form. I have created a label within my form to pull the date/time and I am attempting to patch this to my Lead_History table. 

The key is I need this data to pull into my edit form so I can track the process history of the lead. I have it showing in a gallery in my edit form. I am hoping this makes sense. 

3 REPLIES 3
_douglasromao
Resolver I
Resolver I

Hi @KimberlyM ,

 

You can call the submit and right after that call the Collect (to create a new register) or Patch (to update an existing item) on the history list, and also use the last submited item as a value to this new one, simply using YourFormName.LastSubmitted property.

 

Is that what you are trying to accomplish?

@_douglasromao thank you for your response!

Maybe it helps to see my code.
I have highlighted my code in bright red as it is not happy. It is trying to tell me that my Patch statement has invalid arguments.

//SEND MAIL START

ClearCollect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember1.Selected.FullName, EmailAddressCC)}); 
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember2.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember3.Selected.FullName, EmailAddressCC)});
Collect(ccEmails,{Mail: LookUp(Agents, FullName = ndd_LeadMember4.Selected.FullName, EmailAddressCC)});

Office365.SendEmailV2(LookUp(Agents, FullName = ndd_AssignedTo.Selected.FullName, EmailAddressT), 
//Subject Line 
ndd_AssignedTo.SelectedText.Value & ", you have a new lead!", 
//Message Line 
"<strong>Name: </strong>" & ntxt_FirstName & " " & ntxt_LastName
& "<br><strong>Email: </strong>" & ntxt_Email
& "<br><strong>Phone: </strong>" & ntxt_Phone 
& "<br><strong>Address: </strong>" & ntxt_Unit & ", " & ntxt_Street & ", " & ntxt_City & ", " & ntxt_Province 
& "<br><strong>Listing Information: </strong>" & ndd_ListingType.Selected.Value & ", " & ndd_PropertyType.Selected.Value & ", " & ndd_Location.Selected.Value
& "<br><strong>Source: </strong>" & ndd_Source.Selected.Value

& "<br><br><i>Other Lead Members CC'ed: " & ndd_LeadMember1.Selected.FullName & ", " & ndd_LeadMember2.Selected.FullName & ", " & ndd_LeadMember3.Selected.FullName & ", " & ndd_LeadMember4.Selected.FullName & "</i>", 
{Cc: Concat(ccEmails,Mail,";")}
);

//SUBMIT FORM AFTER THE OTHER PROCESSES SO THAT THE FORM DATA DOES NOT BECOME INVALID
SubmitForm(NewForm);

Patch(Lead_History, Lead_History.LastSubmitted, {Note: "New Lead Created", HistoryDate: "nDateTimeStamp"});

//NAVIGATE AND RESET THE NEW FORM
Navigate( Dashboard, ScreenTransition.Fade ); ResetForm(NewForm);

 

I have also been attempting to get this to work on my edit form (see the screen cap below) and I am so confused and lost between these two pages and getting this to work - I am feeling super under pressure as my project is due tomorrow! I am sure if I can figure out one of these I will be able to get the other to work.

Capture_edit.JPG

cds
Impactful Individual
Impactful Individual

DateValue()

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,994)