cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tonykiefer
Resolver II
Resolver II

Sort combobox items in ascending order with additional column

I have a combobox that display results by id...

tonykiefer_0-1636046926683.png

The "Items" property of the combobox is setup this way...

Sort(Filter(VW_DELETE_CHGQTY_FROM_BOM,PLM_BOM_ID_wSUFFIX=myPLM_BOM_ID).PLM_BOM_RESULT,Ascending)

 

The SQL View for these records has another column called "Seq".

 

I need to sort the records by "Seq" Ascending while still returning the PLM_BOM_RESULT.

 

Any help would be appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@tonykiefer 

Just sort by that column then...

Like this:

Sort(
    Filter(VW_DELETE_CHGQTY_FROM_BOM, PLM_BOM_ID_wSUFFIX=myPLM_BOM_ID),
    Seq,
    Ascending
)

Your results will still have the PLM_BOM_RESULT column to use.

If for some reason you want to strip away all the other columns from the resulting table (not really needed), you can change the formula to:

Sort(
Filter(VW_DELETE_CHGQTY_FROM_BOM, PLM_BOM_ID_wSUFFIX=myPLM_BOM_ID),
Seq,
Ascending
).PLM_BOM_RESULT

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@tonykiefer 

Just sort by that column then...

Like this:

Sort(
    Filter(VW_DELETE_CHGQTY_FROM_BOM, PLM_BOM_ID_wSUFFIX=myPLM_BOM_ID),
    Seq,
    Ascending
)

Your results will still have the PLM_BOM_RESULT column to use.

If for some reason you want to strip away all the other columns from the resulting table (not really needed), you can change the formula to:

Sort(
Filter(VW_DELETE_CHGQTY_FROM_BOM, PLM_BOM_ID_wSUFFIX=myPLM_BOM_ID),
Seq,
Ascending
).PLM_BOM_RESULT

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes AHHH, I see...the sort "by column" comes BEFORE the column I want to display.  Thanks Randy!!!

RandyHayes
Super User
Super User

@tonykiefer 

Yes, once you use a .columnName on a table, PowerApps will narrow the table to only that column.  So trying THEN to sort on another column...well, it no longer exists.

Since Sort returns a column, you can use the .columnName at the end of the Sort to narrow the table if you still need to do that.  Although I would caution about removing all but one column on tables that have been retrieved as the other columns many times contain important data that you can use elsewhere without having to look it up again.  Like the Primary Key, some other column, like a title, etc...

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes ... yes...and since my display and search fields are set to "["PLM_BOM_RESULT"]"...I don't need to return just that value which would then strip the other values.  I see.  Thanks again for the insight Randy!

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,496)