web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Build of flow to creat...
Power Automate
Unanswered

Build of flow to create a dynamic prioritization column in SharePoint

(1) ShareShare
ReportReport
Posted on by 8
Dear community,
 
I could need some support in creating a way to add a priority to items in a list in SharePoint. I have a list with 10 items, that needs to be prioritized from 1 to 10. That is surely easy enough. My problem is that if I change the priority of one item (let's say I move No. 1 down to No. 10), then I would really like for the full list of items to update automatically accordingly (moving the old prio No. 2-10 one step up).
 
I am not very trained in Power Automate and if there is a solution through Power Automate, I would highly appreciate screen dumps:-).
 
 
 
Categories:
I have the same question (0)
  • trice602 Profile Picture
    16,023 Super User 2026 Season 1 on at
    Hi,
     
    I haven't tried this specially for your request, but this looks pretty good.  Check this out!
     

    Steps in Power Automate

    1. Trigger the Flow

    • Create a new flow in Power Automate:
      • Trigger: When an item is created or modified.
      • Configure it to point to your SharePoint list.

    2. Initialize Variables

    • Add an Initialize Variable action to store the updated item's ID:

      • Name: UpdatedItemID
      • Type: Integer
      • Value: ID (Dynamic content from the trigger).
    • Add another Initialize Variable action to store the updated item's new priority:

      • Name: NewPriority
      • Type: Integer
      • Value: Priority (Dynamic content from the trigger).

    3. Retrieve All Items in the List

    • Add the Get Items action:
      • Site Address: Your SharePoint site URL.
      • List Name: Your list name.
    • Sort the items by the Priority column to maintain proper order.

    4. Loop Through All Items

    • Add an Apply to each action to loop through all items returned by the Get Items action.

    Inside the loop:

    1. Condition to Skip the Updated Item:

      • Add a Condition:
        • Expression: items('Apply_to_each')?['ID'] is not equal to variables('UpdatedItemID').
      • If the condition is True, proceed.
    2. Determine the New Priority:

      • Add a Condition:

        • Check if the current item's priority is greater than or equal to the new priority:
          • Expression: items('Apply_to_each')?['Priority'] >= variables('NewPriority').
      • If True:

        • Add an Update Item action to increment the priority of the current item:
          • Priority: items('Apply_to_each')?['Priority'] + 1.

    5. Update the Modified Item's Priority

    • Add an Update Item action after the loop:
      • Update the priority of the modified item to its new value (stored in NewPriority).
     

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and mark as a verified answer to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

  • Chriddle Profile Picture
    8,640 Super User 2026 Season 1 on at
    The idea is to set the priority of the element to an intermediate priority value and set the indices of the sorted array as new priority values:

     
    Compose
    The array with the initial priorities
     
    Compose-ChangePriority
    The item that changes priority with its new priority value
     
    Select-TmpPriority
    Set the intermediate priority value. Substract 0.1 if the priority goes up, add 0.1 if the priority goes down.
    And convert all priority values to float (needed for the sorting)
     
    From:
    outputs('Compose')
    Map:
    if(
    	equals(
    		outputs('Compose-ChangePriority')['name'],
    		item()['name']
    	),
    	setProperty(
    		item(),
    		'priority',
    		if(
    			less(
    				outputs('Compose-ChangePriority')['priority'],
    				item()['priority']
    			),
    			sub(
    				outputs('Compose-ChangePriority')['priority'],
    				0.1
    			),
    			add(
    				outputs('Compose-ChangePriority')['priority'],
    				0.1
    			)
    		)
    	),
    	setProperty(
    		item(),
    		'priority',
    		float(
    			item()['priority']
    		)
    	)
    )
     
    Select-NewPriority
    Set the new priority to array index+1 of the sorted array.
    From:
    range(0, length(body('Select-TmpPriority')))
    Map:
    setProperty(
    	sort(body('Select-TmpPriority'), 'priority')[item()],
    	'priority',
    	add(item(), 1)
    )
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 308

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 226 Most Valuable Professional

Last 30 days Overall leaderboard