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 Apps / add a rank column to a...
Power Apps
Unanswered

add a rank column to a collection

(0) ShareShare
ReportReport
Posted on by 12

Hi,

 

have a collection called "colApplicants":

ApplicantScore
Person A

0.1

Person B0.5
Person C0.3
  

 

Now i want to add a column named "rank", so it should look like this:

ApplicantScorerank
Person A0.13
Person B0.51
Person C0.32

 

Unfortunately, I haven't been able to find a way to do this anywhere other than writing it to a SharePoint list and then applying a flow. However, I would like to implement it using only a powerapp. Does anyone have an idea how this could work?

 

Thanks in advance

Categories:
I have the same question (0)
  • cdwhite Profile Picture
    1,067 Most Valuable Professional on at

    Hi @jhjtbq4hjbt 

    if you just want to visualise this in a gallery, you could put the below Power Fx into the Items property:

     

    ForAll(
     Sequence(CountRows(colApplicants)),
     Patch(
     Index(
     SortByColumns(
     colApplicants,
     "Score",
     SortOrder.Descending
     ),
     Value
     ),
     {RowNo: Value}
     )
    )

     

    You can then add the RowNo output to see the value:

    cdwhite_0-1711546744771.png

    If you want this stored as a collection so you can do extra things with the outputs, you can extend the code like so & add it to a behavioural property such as OnSelect of a button:

    ClearCollect(colApplicantsRanked,
    ForAll(
     Sequence(CountRows(colApplicants)),
     Patch(
     Index(
     SortByColumns(
     colApplicants,
     "Score",
     SortOrder.Descending
     ),
     Value
     ),
     {RowNo: Value}
     )
    ))

    Hopefully the above should work for you!

    ------------------------------------------------------------------------------------------------------------------------------
    If I've answered your question, please mark your post as Solved. You can accept more than one post as a solution.

    If my response was a good one, please give it a Thumbs Up!

    Visit my blog: https://platformsofpower.net

  • jhjtbq4hjbt Profile Picture
    12 on at

    @cdwhite Thanks for the reply

    i will test it

  • Verified answer
    cdwhite Profile Picture
    1,067 Most Valuable Professional on at

    Hi @jhjtbq4hjbt ,

    Please see the 2nd part of my response; you'll need to create a collection using the logic provided.

    I've tested at my end and works as expected 😀
    ------------------------------------------------------------------------------------------------------------------------------
    If I've answered your question, please mark your post as Solved. You can accept more than one post as a solution.

    If my response was a good one, please give it a Thumbs Up!

    Visit my blog: https://platformsofpower.net

  • Verified answer
    v-mengmli-msft Profile Picture
    on at

    Hi @jhjtbq4hjbt ,

     

    Please try this.

    With(
     {
     COL: 
     SortByColumns(
     colApplicants,
     "Score", 
     SortOrder.Descending,
     "Applicant",
     SortOrder.Ascending
     )
     },
     ForAll(
     Sequence(CountRows(COL)),
     Patch(
     Last(
     FirstN(
     COL,
     Value
     )
     ),
     {rank: Value}
     )
     )
    )

     

    Best regards,

    Rimmon

  • jhjtbq4hjbt Profile Picture
    12 on at

    That was very helpfull. Thank you very, very, very much. everything worked. That was very helpfull

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard