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 / DefaultSelectedItems C...
Power Apps
Unanswered

DefaultSelectedItems Combobox where items property is using the DISTINCT Function

(0) ShareShare
ReportReport
Posted on by 274

Hi,

Im having trouble with showing the DefaultSelectedItem in a combobox.  The DefaultItem i am wanting is from a Collection and it matches with the datasource of the Items Property of the Datasource and i'm giving the Combobox a record.  I believe that the issue lies not in my DefaultSelectedItems formula, which is;

 

 

Filter(CatalogueSupplier,CATEGORY = First(ItemToDuplicate).CATEGORY) 

 

 

And that the issue is something to do with Distinct Function i'm using in the Items Property.  The Formula for my Items Property is below.

 

 

Sort(Distinct(CatalogueSupplier,CATEGORY),Value,SortOrder.Ascending)

 

 

 

If i change the Items property to "CatalogueSupplier' then the DefaultSelected Item shows Correctly, but then my combobox then has hundreds of the same rows.  Any thoughts on how to sort this?

Am i best to create a Distinct Collection of the CATEGORY Items on page visible and then use that Collection as my Items Property, or is there a way to change the DISTINCT formula above to show the correct item?

Edited:

 

Thinking on,  Im assuming that as the Combobox is looking for a Column Called "Value".  So i need to Rename the Column in my DefaultSelectedItems from 'Category' to 'Value', however i'm not having any joy with this formula.

 

Filter(CatalogueSupplier, RenameColumns(CatalogueSupplier, "CATEGORY","Value"),CATEGORY = First(ItemToDuplicate).CATEGORY) 

 

Don't think i'm using the RenameColumns Function correctly?

Thanks



Thanks 

 

Categories:
I have the same question (0)
  • d3ell Profile Picture
    274 on at

    Edited Original Post..

     

  • Verified answer
    d3ell Profile Picture
    274 on at

    Managed to get this working with the following.

     

    RenameColumns(Filter(CatalogueSupplier,CATEGORY = First(ItemToDuplicate).CATEGORY),"field_2","Value") 


    Randomly, the CatalogueSupplier Collection had renamed the CATEGORY column to "field_2" so once i worked that out i managed to sort 😁

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