cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tonykiefer
Super User
Super User

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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 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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,347)