Hi,
have a collection called "colApplicants":
Applicant | Score |
Person A | 0.1 |
Person B | 0.5 |
Person C | 0.3 |
Now i want to add a column named "rank", so it should look like this:
Applicant | Score | rank |
Person A | 0.1 | 3 |
Person B | 0.5 | 1 |
Person C | 0.3 | 2 |
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
That was very helpfull. Thank you very, very, very much. everything worked. That was very helpfull
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
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
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:
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
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473