cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Sort column in ascending order

Collect(
coll,
Sort(
Distinct(
JUAT,
Scenario
),
Result
)); - This is in my onvisisbile then in combobox I have coll. It goes from Scenario 1-23. How can I get this to sort from the smallest to biggest number?

8 REPLIES 8
eka24
Super User
Super User

Your formula seem ok but i suggest you use clearCollect.

OnVisible of the screen:

ClearCollect(coll,Sort(Distinct(JUAT,Scenario),Result))

 

Then in the Items property of the Combobox Put:

Coll

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

_Nils_
Advocate I
Advocate I

Hi @powerapps890 

please consider this code in your combobox:

SortByColumns(coll,"Scenario", ascending)

Does that work for you?

 

Best

Nils

The numbers still aren't sorted correctly. @eka24  It goes 1, 10, 11...19, 2,3 ...

No that didn't work can't I just alter the onvisbile some how @_Nils_ 

eka24
Super User
Super User

It seems the Scenario column is a text column containing numbers. Therefore try this:

ClearCollect(Coll,AddColumns(JUAT,"Scenario2",Value(Scenario)))

 

Then on the items of the combobox:

Sort(Coll,Scenario2)

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

This causes my filter to not work. Filter(
collJUATMasterData,
If(
IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All",
true,
C4 in ComboBox1.SelectedItems
) && If(
IsBlank(ComboBox1_2.Selected.Result) || ComboBox1_2.Selected.Result = "All",
true,
C5 in ComboBox1_2.SelectedItems
) && If(
IsBlank(Search_.Text),
true,
Search_.Text in C2
) && If(
IsBlank(ComboBox1_1.Selected),
true,
C3 in ComboBox1_1.SelectedItems.Value
)
) - It is combobox1_2 that is now giving the error which is the scenario combobox. How do I edit the filter @eka24 

eka24
Super User
Super User

Is this same as you first post or another question. I cant see the relationship

 

Is the formula i gave sorting properly?

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

No because now the gallery won't load. It doesn't like when I change coll to what you gave me @eka24 . It is the same thing the gallery filter is just connected to the combobox

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,042)