logo
search
Others

How to Create a Unique Order ID in Power Automate from SharePoint Changes

Kushani NimanthikaKushani Nimanthika Oct 21, 2026 868 views

Question details

The user needs to set up a Power Automate flow that generates a unique order number in a new SharePoint list when an existing item is modified, while avoiding duplicate entries upon repeated edits.

How to Create a Unique Order ID in Power Automate When a SharePoint Item Changes
Product
Power Automate and SharePoint
Device & OS
not provided
Scenario
Automating order creation across SharePoint lists based on item modifications without triggering infinite loops.
Observed behavior
The goal is to automatically generate a formatted, unique order ID (e.g., using an 'ORD-' prefix) and update the original list to mark the item as processed, successfully preventing duplicate triggers.
Before you start

Ensure you have Edit permissions on both the source and destination SharePoint lists, and an active Power Automate license to create and manage automated cloud flows.

Solution 1Recommended

Build the Power Automate Flow to Generate a Unique Order ID

Use trigger conditions and SharePoint list item IDs to reliably generate sequential, unique order numbers while preventing loop triggers.

To prevent duplicate orders when the trigger item is edited repeatedly, you must use a trigger condition combined with a write-back update to the original SharePoint list.

1
Configure the SharePoint Trigger

In Power Automate, click 'Create' and select 'Automated cloud flow'. Choose the SharePoint trigger 'When an item is created or modified' and link it to your source list (List A).

2
Add a Trigger Condition

Click the three dots (...) on the trigger action, select 'Settings', and scroll to 'Trigger Conditions'. Add an expression such as @equals(triggerOutputs()?['body/CreateOrder'], true) so the flow only runs when specific criteria are met.

3
Create Item in Destination List

Add a new step and select the SharePoint 'Create item' action for your destination list (List B). Map the relevant customer information fields dynamically from the trigger outputs.

4
Generate the Unique ID

Use the automatically generated ID from the 'Create item' action (List B) to form your unique order number. You can format it by adding a prefix using a Compose action with an expression like concat('ORD-', outputs('Create_item')?['body/ID']).

5
Update the Original Item to Prevent Duplicates

Add an 'Update item' action pointing back to List A. Update a status column (e.g., set 'Order Processed' to 'Yes' and 'CreateOrder' to 'No'). This ensures the trigger condition in step 2 will fail on future modifications, preventing duplicate orders.

Build the Power Automate Flow to Generate a Unique Order ID
Avoid Infinite Loops: Updating the original item (List A) within the same flow will re-trigger the flow unless you strictly implement the trigger condition to ignore already-processed items.
Free Microsoft Office alternative

Boost Your Office Productivity with WPS Office

While Power Automate and SharePoint handle your cloud workflows, WPS Office is the perfect lightweight, free alternative for handling your generated Excel reports, Word documents, and PDF invoices.

  1. 1. Download WPS Office: Visit the official WPS website and click 'Download' to get the free office suite installer.
  2. 2. Install the Software: Run the downloaded installer and follow the quick setup wizard to install the software on your computer.
  3. 3. Manage SharePoint Exports: Open any downloaded SharePoint list data exports (.xlsx) directly in WPS Spreadsheet with perfect formatting retention.
Fully compatible with Microsoft Excel (.xlsx) and Word (.docx) formats exported from SharePoint.Built-in PDF toolkit for seamlessly converting and signing your generated order invoices.Lightweight software with a familiar tabbed interface for a quick transition.Free to use with rich templates for business reports and tracking sheets.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my Power Automate flow creating duplicate orders?

Duplicates usually occur if the flow triggers multiple times upon consecutive item modifications. You must use trigger conditions in your flow settings to ensure it only runs once per approved item, and update the source item's status at the end of the flow.

Can I reset the auto-incrementing SharePoint ID for my order numbers?

The default SharePoint list ID column cannot be reset or modified. If you need a resettable sequence (like restarting at 1 every year), you must maintain a separate configuration list that stores the current highest number.

How do I add leading zeros to my SharePoint order ID in Power Automate?

You can pad the ID with leading zeros using a Power Automate expression. For example, using the expression formatNumber(triggerOutputs()?['body/ID'], '0000') will format an ID of 5 as '0005'.

Why does updating List A cause an infinite loop in my flow?

Updating List A counts as a modification, which is the exact event triggering your flow. Adding a trigger condition that stops the flow if the item is already marked as 'processed' effectively breaks this loop.