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
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 (1,937)