web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Bold and color a singl...
Power Apps
Unanswered

Bold and color a single item in a combo box list and fix to either top or bottom of list

(0) ShareShare
ReportReport
Posted on by 634

Here is what I am looking to do. If a user selects 'Add Product' from the combo box list shown below and text field appears along with an 'Add' button. This is to allow the user to add a new product to the list. What I would like to do is differentiate this list item from the others. I'm thinking making it bold, changing the color and positioning it at either the top or bottom(probably top) of the list (which will be sorted alphabetically) would be the way to go. Is this possible?

 

bold list item.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @Future_Vision ,

    You can certainly sort alphabetically - what are the Items of the Combo Box?

    You cannot however make one item appear different form the others (font/bold).

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • Future_Vision Profile Picture
    634 on at

    That's what I was thinking. Alphabetical but I added '**' to the front and end of the AddProduct like this '** Add Product **'. That worked in one case but in another case any new items I added to the list would sort to the top. Almost like they were keying off some other value when sorting alphabetically. Any ideas why that would happen?

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @Future_Vision ,

    Can you please supply the Items of the Combo Box and I may have some idea.

  • Future_Vision Profile Picture
    634 on at

    This is just one example. I've had added other values in this combo box using a Patch to the datasource and they always get pushed to the top on the combo box refresh.


    3rd Party 1
    ** Add 3rd Party **
    3rd Party test

  • Future_Vision Profile Picture
    634 on at

    Here's a little more info I found out as I've tested more. The items I add do sort alphabetically but above the ** Add 3rd Party ** item. If I change to descending I get it flipped:

     

    3rd Party test
    ** Add 3rd Party **
    3rd Party 1

    ...

    additional items in descending alphabetical order

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @Future_Vision ,

    You still have not provided the Items (your exact code) for the combo box.

  • Future_Vision Profile Picture
    634 on at

    Pretty simple.

     

    Sort('Third Parties','Third Party (cr9c7_thirdparty)',Ascending)

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @Future_Vision ,

    Try this

    Sort(
     'Third Parties'.'Third Party (cr9c7_thirdparty)',
     'Third Party (cr9c7_thirdparty)',
     Ascending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Future_Vision Profile Picture
    634 on at

    This works but it now breaks my DefaultSelectedItems functionality. Here's a little background on what happens.

     

    1. If a user selects "** Add 3rd Party**" from the combobox and a textbox and button become visible.
    2. The user enters the new 3rd party in the text box and clicks the button. A variable is set to hold this value and while the data is added to the datasource.
    3. The combobox is refreshed with the DefaultItemSelected being the variable I set with the button.

    This is the code I used on the button

    UpdateContext({newThird:Patch('Third Parties', {'Third Party (cr9c7_thirdparty)':'Add 3rd Party TB'.Value})});Reset('Add 3rd Party TB')

     

    The code in the DefaultSelectedItems is

    newThird

     

    It works without the sort code you provided but once I add the sort code it breaks this functionality

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    @Future_Vision ,

    Without getting into your other logic, the DefaultSelectedItems for the Combo Box when using the Items supplied would normally be

    {'Third Party (cr9c7_thirdparty)':ThisItem.'Third Party (cr9c7_thirdparty)'}

    It is a complex field type and you need to specify which "part" of the field needs to display and what to display in it, so maybe this is what you need

    {'Third Party (cr9c7_thirdparty)':newThird.'Third Party (cr9c7_thirdparty)'}

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard