A few days before, I was required to send an email containing project names and serial numbers. To achieve this, I used the range() function in Power Automate, which generates an array of integers.
In this tutorial, I will explain how to provide a sequential serial number for a list of SharePoint items using the Power Automate range() function, along with an example.
Power Automate range() Function
The Power Automate range() function will generate the sequential range of integers that starts from the start index to the count.
In simple terms, we can tell it will return an array of integers that start from a specific integer.
Syntax: range([Start Index:Integer],[Count:Integer])
Parameters:
- Start Index: An integer value that starts the array as the first item
- Count: The number of integers in the array.
Example: range(1,5) => Returns output [1, 2, 3, 4,5]
Note: The count parameter value must be a positive integer that doesn't exceed 100,000.Example:- Power Automate to Generate a Sequence Serial Number
In this example, I will explain how to automate serial number generation without a loop inside flows.
Scenario: I have a Project list with the Project Name, as you can see in the attached screenshot below. My requirement is to send an email about Project Names along with the serial number of each project.

Follow the step-by-step guide:
1. In the Power Automate Home page, Select Instant cloud flow -> Add Manually trigger a flow trigger.
2. To fetch the Project Names from the SharePoint list, add the Get items action and provide the Site Address and List Name.

3. Next, add Create HTML table to get the range values from the SharePoint list.
- From: Add the code below.
range(0,length(outputs('Get_items')?['body/value']))Click on Advanced Parameters to display all the options.
Columns: Select the Custom option from the drop-down.
| Header | Value |
| S.NO | add(1,item()) |
| Project Name | outputs(‘Get_items’)?[‘body/value’][item()]?[‘ProjectName’] |

4. Add a Send an email(v2) action with the required parameters like To, Subject, and Body to send an email.

Once the flow is done, save and run the flow manually.
Result:

Conclusion
I hope you now understand how to generate the sequence serial numbers in a Power Automate flow using the range() function.
You can also check out:
- Use Skip() Function in Power Automate
- Check if a String Contains Numbers in Power Automate
- Power Automate dayOfMonth() Function + Power Automate dayOfYear() function
- Power Automate indexOf() Function | Power Automate lastIndexOf()
- Power Automate isInt() Function + Examples
- Power Automate addDays() Function + Examples

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.