cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver III
Resolver III

ComboBox Sort+Filter breaks search function

Hello All,

 

I'm running into a tiny issue with a combobox with searchfield.

The combobox is filled as such:

If(!IsBlank(ComboBoxNaam.SearchText);(DataSource)

However my results are not sorted in any particular way and I wish to sort them based on A-Z.

I tried this:

If(!IsBlank(ComboBoxNaam.SearchText);SortByColumns(DataSource;"Naam";Ascending)

 However once I change the code to include the sortbycolumns the [allow search] attribute is automatically turned off. I can switch it back on but the searchfield won't work regardless of the [allow search] attribute's value.

 

Having the same problem in a different ComboBox where the working (non sorted) code looks like this:

If(!IsBlank(ComboBoxOrg.SearchText);Filter(Distinct(DataSource;Titel);Result <> "a"))

 

Perhaps I am doing something wrong with the expressions but perhaps not, im not entirely certain.

4 REPLIES 4
Highlighted
Super User III
Super User III

Hi @gjeh 

What is the Items property of the combobox?

Highlighted

the datasource is a sharepoint list, the items are list items.

Highlighted

@gjeh 

Sort the list at the datasource level for the combobox.

Sort(SPlist,Naam,Ascending)
Highlighted

Thanks for your reply.

 

But if i edit this code:

 

If(
    !IsBlank(ComboBoxOntvangerINK.SearchText);'Office365-gebruikers'.SearchUser({searchTerm:ComboBoxOntvangerINK.SearchText})
)

 

to

 

If(
    !IsBlank(ComboBoxOntvangerINK.SearchText);Sort('Office365-gebruikers'.SearchUser({searchTerm:ComboBoxOntvangerINK.SearchText});Ascending)
)

 

my result is this: (After turning setting 'allow search' back to true because for some reason this keeps turning off everytime i edit the formula)

sorting.png

as you can see it is not sorted alphabetically, unless it is sorted on a different column than name.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,236)