cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rsparks
Helper V
Helper V

Add an incrementally increasing ID to each item on a Sharepoint list

Every time a user makes a submission using the form I've got set up, the line ID just increases by 1 (just the standard sharepoint ID column). 

How can I set it up to increase by 11 every time?

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @rsparks 

 

WHat is the error? any error mesage or did it just not update the data

Did you check in SP?

 

If LineId is a text field then

 

Patch('New Vehicle Request', EditForm1.LastSubmit,{LineID: Text(EditForm1.LastSubmit.ID*11)});

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
RezaDorrani
Dual Super User II
Dual Super User II

Hi @rsparks 

 

The shsarepoint ID column is an internal column and will only increase by 1 each time

Your best bet would be to set another column as Line ID

 

What you can do is the formcontrol has an OnSuccess property

On OnSuccess add the following patch command to update the lineid

 

Patch(datasource, FormName.LastSubmit,{lineID:  FormName.LastSubmit.ID*11)

 

datasource - sharepoint list 

FormName - name of form control

lineID - name of column storing line id

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

Can't seem to get it working.

 

The code I'm trying to use is:

 

Patch('New Vehicle Request', EditForm1.LastSubmit,{LineID: EditForm1.LastSubmit.ID*11});

 

The list name is New Vehicle Request, the form name is EditForm1, and the column is called ListID. The list also contains the standard ID column.

RezaDorrani
Dual Super User II
Dual Super User II

Hi @rsparks 

 

WHat is the error? any error mesage or did it just not update the data

Did you check in SP?

 

If LineId is a text field then

 

Patch('New Vehicle Request', EditForm1.LastSubmit,{LineID: Text(EditForm1.LastSubmit.ID*11)});

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Working now, thanks

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,276)