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

Search filtering a comboBox

Hello,

 

I have a ComboBox which displays a very big list, but, because of the amount of data, the list isn't complete.

So to bypass this problem I decided to place a SearchBox to filter thus Combobox.

But i have some issues.

 

Here is my formula which works on a test gallery :

 

If(
    IsBlank(TextSearchBoxVille);
    Distinct(
        Tb_VillesIDF;
        Title
    );
    SortByColumns(
        Filter(
            [@Tb_VillesIDF];
            StartsWith(
                Title;
                TextSearchBoxVille.Text
            )
        );
        "Title";
        Ascending
    )
)

 

The first condition is functionnal, but the second one give me an empty list in the combobox instead of the gallery which is ok.

 

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
Spoon92
Frequent Visitor

I found the issue.

 

It was simple. When I was typing something in my SearchTextBox, the combobox displayed just white lines. So i thought that the formula wqas good, but the line displayed was aiming an empty column in my database.

 

Everything was correct, but i missed one step. I simply clicked on my field, and click on the field button in the property and choose my column in the "Main text" dropdown.

And that's it!

 

Spoon92_0-1604391851075.png

 

 

Thanks All

View solution in original post

5 REPLIES 5
mdevaney
Super User III
Super User III

@Spoon92 
Which section of your code do you believe is causing issues?  It’s not clear to me what is meant by 2nd condition.

 

---
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."

Spoon92
Frequent Visitor

I was talking about the "False condition" of the If :

SortByColumns(
        Filter(
            [@Tb_VillesIDF];
            StartsWith(
                Title;
                TextSearchBoxVille.Text
            )
        );
        "Title";
        Ascending
    )

 I don't understand why this don't work in my combobox.

 

All this code is in my Items property of the combobox.

@Spoon92 
There is nothing wrong with the code here that I can detect so I see two possibilities.

#1.  TextSearchBoxVille.Text does not hold any search text or is the wrong target

#2.  The result actually has 0 matches using STARTSWITH.

 

SortByColumns(
        Filter(
            [@Tb_VillesIDF];
            StartsWith(
                Title;
                TextSearchBoxVille.Text
            )
        );
        "Title";
        Ascending
    )

 

Can you please share a screenshot of your app?

 

---
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."

Spoon92
Frequent Visitor

@mdevaney 

Here you can see two screenshots of my app. The first one is with the TextSearchBoxVille empty  and the second one with 3 letters in it.

 

Capture1.PNG  Capture2.PNG

 

Field "Ville" = TextSearchBoxVille

DropDown = DataCardValue5

 

Spoon92
Frequent Visitor

I found the issue.

 

It was simple. When I was typing something in my SearchTextBox, the combobox displayed just white lines. So i thought that the formula wqas good, but the line displayed was aiming an empty column in my database.

 

Everything was correct, but i missed one step. I simply clicked on my field, and click on the field button in the property and choose my column in the "Main text" dropdown.

And that's it!

 

Spoon92_0-1604391851075.png

 

 

Thanks All

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

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

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (17,248)