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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Update a ranking sort ...
Power Automate
Unanswered

Update a ranking sort field value based on another number field's value

(0) ShareShare
ReportReport
Posted on by 17

Hi all, 

I initially had this working after finding help on the community forum https://answers.microsoft.com/en-us/msoffice/forum/all/format-list-view-of-items-for-top-3-highest-using/4ec7ab55-491d-41b2-a6fb-ab0af79c66aa?messageId=ee6eb16b-7ff1-4b7c-accb-a8bb566b4323.

 

However, now it doesn't work as intended. The concept is a number field to which I need to apply a 1 for the highest value(s), 2 for the second, and 3 for the third highest value(s). This was working but I notices that it was not updating the existing items that had been previously ranked 1 that should be 2 or 3 now.

 

If anyone has a better way or an improvement, maybe something I've overlooked that would be great!

 

Screenshot 2024-05-02 at 5.07.31 PM.png

 

I hope that my further explanation will help explain this situation and what my goal is.

 

The below is the what my goal is. I update a list and have a custom view that is used in a SharePoint page.

Screenshot 2024-05-03 at 8.46.49 AM 2.png

Here are the PA Flow actions in sequence that I have now:

  1. I get the items from the list
    Screenshot 2024-05-03 at 8.17.18 AM.png
  2. Initialize a variable to be an Array
    Screenshot 2024-05-03 at 8.17.46 AM.png

  3.  Compose the list items field "Connected" which is a number field which will be used to identify the most to least amount for ranking using a "Sort" field

    Screenshot 2024-05-03 at 8.18.15 AM.png
    1. The Compose outputs are appended
      Screenshot 2024-05-03 at 8.18.38 AM.png

  4. Then the I compose the apply to each data "Number" and map it to {item()} which then converts it automatically in PA to current item, not sure why
    Screenshot 2024-05-03 at 8.19.09 AM.png
  5. Next I compose 1st, 2nd, and 3rd place data
    Screenshot 2024-05-03 at 8.19.33 AM.png
    1. I use the following for 1st, 2nd, and 3rd place compose actions in this order
      body('Select')[0]
      body('Select')[1]
      body('Select')[2]
  6. Using the "Get Items..." action from above to apply to each for 3rd place
    Screenshot 2024-05-03 at 8.20.41 AM.png

    1. then the condition takes the the "Outputs" from the compose for 3rd place and checks if equal to  the Connected field's value
       Screenshot 2024-05-03 at 8.21.07 AM.png
    2. Then the item's "Sort" field is then updated

      Screenshot 2024-05-03 at 8.22.19 AM.png
    3. then "a" and "b" is repeated in the following 2nd and 1st place in that order

Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard