cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

advice on how to achieve highest value

I'm trying to figure out the best way to achieve the following or if it's even possible.

 

I have a sharepoint list with items and each item as a value score so the list looks something like this.

 

ItemScore
Item12
Item2 2
Item33
Item42
Item54

 

In the powerapp my  users pick items from the list through a combo box and they are concatenated and stored in a text field.

I want the highest score to be stored in a separate text box as I need to use it for something else.    So for example in the list above If they chose Item1 , Item2 and Item5  I would like "4" to be stored somewhere or if they chose Item1 and Item3 and Item4 then it would be "3" etc..

 

I'm thinking collection of somekind? I know how to get the scores and sum them but not sure how to get the highest one?  Any advice ?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @Anonymous you can achieve that with a collection indeed. add the function to the onselect property of the gallery:

OnSelect = (_GetMax,Gallery.Selected) and add a label with its text as Max(_GetMax,Value).  Or you can add to OnSelect = Set(_MaxVal,If(Value(Gallery.Selected.Value) > _MaxVal,Value(Gallery.Selected.Value),_MaxVal)) now set the text value of the label to _MaxVal

 

both will work

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

View solution in original post

2 REPLIES 2
TheSec
Helper I
Helper I

I haven't tried it yet, but there should be a MAX function that gives you the value directly by providing table and column.

If not just sort the table-column descending und get the first value with First().

If you struggle I might find some time to check this out.  

rubin_boer
Super User
Super User

hi @Anonymous you can achieve that with a collection indeed. add the function to the onselect property of the gallery:

OnSelect = (_GetMax,Gallery.Selected) and add a label with its text as Max(_GetMax,Value).  Or you can add to OnSelect = Set(_MaxVal,If(Value(Gallery.Selected.Value) > _MaxVal,Value(Gallery.Selected.Value),_MaxVal)) now set the text value of the label to _MaxVal

 

both will work

 
hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (4,104)