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.

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
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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,189)