While working on a Leave request application, I needed to create a unique ID whenever a user submitted an item to the SharePoint list. In this case, Power Automate is the best option for generating a unique ID for each SharePoint list item.
In this tutorial, I will explain how to generate a unique ID for a SharePoint list item using Power Automate with a few steps.
Generate a Unique ID for a SharePoint List item Using Power Automate
Let’s start how to create a unique ID using Power Automate step by step:
I have a SharePoint list named Project Tasks with the following columns and data types:
| Columns | Data Types |
|---|---|
| Unique ID | Title(Single line of text) |
| Task Name | Single line of text |
| Description | Multiple lines of text |
| Assigned To | Person or Group |
| Due Date | Date and time |
| Status | Choice |
| Priority | Choice |
| ID | Number |

1. Open the Power Automate home page, click + Create, select the Automated Cloud Flow, enter the flow name, and choose the trigger’s flow When an item is created.

2. Now, provide the Site Address and List Name where you will create a Unique ID for the SharePoint list.

3. Next, I will create a variable to store the prefix of the unique ID. So, I added an ‘Initialize variable’ action with the following parameters:
- Name: varUniqueIDPrefix (Variable Name)
- Type: String
- Value: PT (This is optional)

4. Then, I will add a compose action to generate a random number using the below expression:
Inputs = rand(1,9999)
5. Now, using the Power Automate Concat function, I will concatenate the initialized variable, the output from the previous ‘Compose‘ action, and the SharePoint ID column. This will generate a unique ID for each SharePoint list item.
To do this, add the ‘Compose‘ action and provide the Inputs Parameters as below expression:
concat(variables('varUniqueIDPrefix'),outputs('Compose'),triggerBody()?['ID'])
6. Now, we will add the Unique ID to the SharePoint list. So, Add the ‘Update item’ action and provide the Site Address, List Name, and ID.
Then, using the Advanced parameters, provide the output of the previous ‘Compose‘ action.

Once the Flow is ready, we will move forward to run the Flow.
Run the flow to generate a Unique ID in SharePoint List
Now click on Save and run the Flow. Then, go to the specific SharePoint list (Project Tasks) and add an item to the list.

Once you add an item, you can see that the flow ran successfully.

Then, go to the SharePoint list and refresh it. You will see that the unique ID has been successfully created.

This way, you can create a unique ID for each item in your SharePoint list.
Related Power Automate tutorials:
- Update a SharePoint List Item from another SharePoint List Using Power Automate
- Get Unique Values from an Array in Power Automate?
- Get Distinct Values from SharePoint List using Power Automate?
- Convert Word Files to PDF Using Power Automate? [Without Using Premium Connector]

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.