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

Duplicating SharePoint ID Number to New Column in Same Record

I am trying to duplicate my ID number into another table cell (from ID to ID Digit) onSuccess automatically so I do not have to go in and edit my SharePoint list manually. The screen shot I have here shows where ID = 2776 and ID Digit = 2776 I have manually typed it in.

KimberlyM_0-1598392891065.png

This is my form that I want to be able to complete this on:

KimberlyM_1-1598393052556.png

When I click on the checkmark in the top right corner I have it's onSelect property set to:
SubmitForm(NewForm);

On the form I have onSuccess set as below so that a :
//ADD NEW LEAD CREATED ENTRY INTO LEAD_HISTORY SHAREPOINT LIST UPON CREATION OF NEW LEAD
Set(varNewLeadID, NewForm.LastSubmit.ID);
Patch(Lead_History, Defaults(Lead_History), {Title: "", Note: "New Lead Created", HistoryDate: Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss"), AgentCommenting: "", LeadID: varNewLeadID});

So what I was thinking originally that failed, to Patch Lead_Data (the SP list my form Submits to when I click on the checkmark) ID_x0020_Digit : varNewLeadID. So:
Patch(Lead_Data, Defaults(Lead_Data), {ID_x0020_Digit: varNewLeadID});

 

The outcome was the correct number but in a new record. How do I get it to post to the same record?
Honestly, I am thinking so hard on this that I am guessing that I am overthinking this. Thanks in advance for help!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @KimberlyM ,

Yes I know exactly what you are talking about - I wrote a blog on it.

Please look at the "Bigger than 4,000" section - you need to Patch it back to the record and refer to the LastSubmit.ID in the syntax.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @KimberlyM ,

You are using the syntax for a new record - try this

Set(
   varNewLeadID, 
   NewForm.LastSubmit.ID
);
Patch(
   Lead_History, 
   {ID:varNewLeadID},
   {
      Title: "", 
      Note: "New Lead Created", 
      HistoryDate: Text( Now(), "[$-en-US]mm/dd/yyyy hh:mm:ss"), 
      AgentCommenting: "", 
      LeadID: varNewLeadID
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

I don't want this ID number into Lead_History but into my Lead_Data table where the ID number actually is. Basically I am using this to call up data for my collection 2000 items at a time. Basically when it submits my form and creates the record ID number I want this number to be duplicated into the cell "beside" it in the same SharePoint table. If I Patch it there it creates a new record that has no details except for the ID number and the patched ID number of the previous item. (I am really hope I am making sense).

Hi @KimberlyM ,

Yes I know exactly what you are talking about - I wrote a blog on it.

Please look at the "Bigger than 4,000" section - you need to Patch it back to the record and refer to the LastSubmit.ID in the syntax.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Thank you for your help @WarrenBelz ! Your comment and blog was a great assist to me as I was able to figure out exactly what I needed to do. I actually needed to patch my Lead_Data list and not my Lead_History so it took 3 attempts to work through and I am ready to move on to my next task! So thank you again.

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