How to Generate a Unique ID for a SharePoint List item Using Power Automate?

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:

ColumnsData Types
Unique IDTitle(Single line of text)
Task NameSingle line of text
DescriptionMultiple lines of text
Assigned ToPerson or Group
Due DateDate and time
StatusChoice
PriorityChoice
IDNumber
Generate Unique ID in SharePoint List using power automate

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.

How do I generate a unique ID to SharePoint using Power Automate

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

How to create unique ID in SharePoint list using Power Automate

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)
How to get SharePoint list id in Power Automate

4. Then, I will add a compose action to generate a random number using the below expression:

Inputs = rand(1,9999)
Power Auomate Creating a custom unique ID in a SharePoint list

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'])
How to create a unique identifier in your Power Automate

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.

How To Generate Unique Id In Sharepoint List using Power Automate

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.

Grabbing a unique ID from a sharepoint list using Power Automate

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

Unique ID Generate Flow Run in Power Automate

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

Create a Unique ID for SharePoint List item Using Power Automate

This way, you can create a unique ID for each item in your SharePoint list.

Related Power Automate tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…