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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,930)