cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Get only distinct values in combo box

Is there any way to show only distinct values in Combo box?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Maheshwari ,

Could you please share more details about the formula you typed within the Items property of the ComboBox?

 

Based on the needs that you mentioned, please consider take a try with the following workaround:

Set the Items property of the ComboBox to following:

Distinct('Your DataSource', ColumnName).Result

If the ColumnName is a Choice type column, please modify above formula as below:

Distinct('Your DataSource', ColumnName.Value).Result

 

In addition, I also think GroupBy function could also achieve your needs. Please set the Items property of the ComboBox to following:

GroupBy('Your DataSource', "ColumnName", "GroupData")

then specify the "ColumnName" as Display column value within the ComboBox.

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Super User III
Super User III

@Maheshwari 

Yes, you can do this by using the DISTINCT function in the Items property of the ComboBox.

 

Distinct(your_datasource_name, your_column_name)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Super User III
Super User III

On the Items of the combobox put:

Distinct (Datasource,ColumnName)

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

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.

yes I have already tried that ,but it doesnot work,it displays only empty tabs.

but it works with dropdown

@Maheshwari 
You need to also define the DisplayFields and SearchFields properties like this:

 

["your_column_name"]

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Already tried it..but doesnt work

 

@Maheshwari 

You'll need to supply more information about the data you used DISTINCT on.  Can you please put this code in the OnSelect property of a new button and then post a screenshot of what the resulting collection looks like?

ClearCollect(colTest, Distinct(my_datasource, my_column))

 

Another idea is to use this code in DisplayMode

["Result"]

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

Community Support
Community Support

Hi @Maheshwari ,

Could you please share more details about the formula you typed within the Items property of the ComboBox?

 

Based on the needs that you mentioned, please consider take a try with the following workaround:

Set the Items property of the ComboBox to following:

Distinct('Your DataSource', ColumnName).Result

If the ColumnName is a Choice type column, please modify above formula as below:

Distinct('Your DataSource', ColumnName.Value).Result

 

In addition, I also think GroupBy function could also achieve your needs. Please set the Items property of the ComboBox to following:

GroupBy('Your DataSource', "ColumnName", "GroupData")

then specify the "ColumnName" as Display column value within the ComboBox.

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you so much. This really helped me to think over another solution.

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (29,998)