cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Filter by text then dropdown

Filter(CCB, Filter.Text in 'Requirement Source')

This is the statement I have in the gallery. I first want it to filter by a text filter. Then I want to be able to filter it by a drop down menu. How do I add this to the existing filter statement?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

So I think we finally got it haha - if the dropdown doesn't have a default value then we will need to create logic to handle the empty dropdown otherwise it is always going to check for that. We could put this in the Filter but then it is not-delegable so we need to put it outside the Filter().

If(
    IsBlank(Dropdown1.SelectedText.Value),
    Filter(
        CCB,
        StartsWith('Requirement Source',Filter.Text)
    ),
    Filter(
        CCB,
        StartsWith('Requirement Source',Filter.Text),
        'Functional Area' in Dropdown1.SelectedText.Value
    )
)

 

View solution in original post

14 REPLIES 14
Highlighted
Helper I
Helper I

You need to switch your 'in' expressions since you are trying to say Filter CCB where 'Requirement Source' value is in the string "...". As well depending on the type of text filter you are trying to apply (and whether or not you are concerned w/ Delegation) I'd take two routes.

  • Option 1 - filter the data where the 'Requirement Source' value is in the search box AND is in the dropdown selected string
    • probably best bet if you want to do the search and dropdown match on the same field
  • Option 2 - Search CCB based on the text appearing in the 'Requirement Source' field then apply the Filter based on the dropdown value.
    • best bet if you want to do a search on one or multiple fields and then apply the dropdown.
// -- Option 1
Filter(
    CCB,
    'Requirement Source' in TextInput.Text,
    'Requirement Source' in Dropdown1.SelectedText.Value
)
// -- Option 2
Filter(
    Search(
        CCB,
        TextInput.Text,
        "Requirement Source (internal name in double quotes)"     
    ),
    'Requirement Source' in Dropdown1.SelectedText.Value
)

 

Highlighted

Capture.PNG

I am getting an error. I want it to search by requirement source then functional area with a dropdown.

Highlighted

@powerapps890 apologize please update "TextInput.Text" and "Dropdown1.SelectedText.Value" to be "Filter.Text" which is the component in your PowerApp. Otherwise replace them both with empty stings (two double quotes "") and the errors will go away for the time being.

Highlighted

Capture.PNG

It says the search function is having issues. It filters in the filter text box first by req source then in the dropdown by functional area.

Highlighted

That is a "Delegation" warning which doesn't necessarily mean it's having issues but if this dataset is on SharePoint and is expected to be large we will have to use something other than Search(). In that case we have to fallback to the following:

Filter(
    'Template Approvers',
    StartsWith('Requirement Source',Filter.Text),
    'Functional Area' in Dropdown1.SelectedText.Value
)

 

Highlighted

It said that all of the arguments and identifiers were invalid.

Highlighted

No data loaded it is just blank

Highlighted

Sorry I was sloppy in writing that last response and messed up the source property of the Filter() function. It should be updated to:

Filter(
    CCB,
    StartsWith('Requirement Source',Filter.Text),
    'Functional Area' in Dropdown1.SelectedText.Value
)

 If it doesn't work, please take a photo again as that helped me understand what was erroring.

Highlighted

There is no error nothing shows up. 

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 (11,532)