cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Flow/PowerAutomate: How to auto increment the data in sharepoint online list after 1) form submitted and 2) after approver approved the request?

Hi,

 

How to auto increment data in SP Online List. I have 19 data but it only store one data in a row and keep replacing the existing data. 

 

It supposed to list all 19 data submitted through form submission and approval.

3 REPLIES 3
Super User
Super User

Hi @Anonymous, assuming you are not using the ID column in your SharePoint list for this then it can be achieved quite easily but needs a separate list to hold the next incremental value.

In this example we have our main list,CropHarvest, where the current highest incremental value is 971 which means that when we create a new item we want the next one to be 972:

1 Main List1 Main List

 

We also have a list called Increment which holds the next value 972:

2 - Increment list with next value2 - Increment list with next value

 

The trigger in our flow is a SharePoint "When a new item is created". The first action is to get the items (there's only 1) from the Increment list:

Flow trigger and  Get Increment listFlow trigger and Get Increment list

 

We add an apply to each control and select value from the dynamic content box. We then add a Compose control and the input for this is the NextValue from Get items from the Increment list:

Apply to each and ComposeApply to each and Compose

 

We now want to update our main list with the value in the Compose control we created above. So the outputs of that Compose are added to the Increment column. The Id is selected from the dynamic content and make sure you select the ID in the When an item is created section:

 

Update the main listUpdate the main list

 

We then want to update the Increment list with the new NextValue. So we create a Compose control and use the expression 

add(outputs('ComposeNext'),1) to add 1. We then update the Increment list with the output of that Compose:
 
Add 1 to the item in the Increment listAdd 1 to the item in the Increment list

 

A few seconds after the flow has run when the new item is created you'll see that in the main list the column for the incremental value gets updated:
 
Main list updatedMain list updated

 

And the Increment list has also been updated with the next value:
 
Increment list updatedIncrement list updated

 

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
 
 

 

 

 

 

 

 

 

 

 

Anonymous
Not applicable

Hi,

 

Given solution is quite contain many number of steps I have to include in my existing complex flow template. 

 

Alternatively, can you show the steps if I used ID column to increase the data after approval get approved?

 

I'll try steps above again after I try this one.

You can't change the ID number so my example above is a way to do the increment even though it has quite a few steps.

Rob
Los Gallardos

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (3,696)