web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using search function ...
Power Apps
Answered

Using search function on combobox which allows multiple selections

(0) ShareShare
ReportReport
Posted on by 30

Hey all,

I'm trying to filter a data table based purely on text entered into a search bar. As the search function doesn't allow you to take the .Selected.Value of your search fields, I've been using AddColumns to create a temporary column with just the selection text which the Search function can then work with. This approach doesn't seem to work with multiple selection combo boxes, however. Is there any way to get my approach to work with  multiple selections without having to do a whole rewrite of my code?

 

In the below code, 'Action On' and 'Project Actioned' are the multi-choice columns.

 

Cheers,

 

 

SortByColumns(
 Search(
 AddColumns(ECR, 
 "StatusVal", Status.Value, "ActionOnVal", 'Action On', "ProjActionedVal", 'Project Actioned', "DepInChargeVal", 'Department in Charge'.Value,
 "ProductVal", Product.Value, "ComponentVal", Component.Value, "SubAssemVal", 'Sub Assembly'.Value, "RaisedByVal", 'Raised By'.DisplayName, "WhoVal", Who.DisplayName
 ),
 ECR_IssueFilterInput.Text, "ECR_ID", "ACT_ID","Title", "Comments", "StatusVal", "ChangeDone", "DepInChargeVal", "ProductVal", "ComponentVal", "SubAssemVal", "RaisedByVal", "WhoVal"),
 "ECR_ID", If(ECRIDSortOrder = Ascending, Ascending, Descending))
)

 

 

Categories:
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @Clemented ,

    Try the below - also gives you some "pre-filtering for a larger same to search on (it is still not Delegable though)

    With(
     {
     wList:
     Filter(
     ECR, 
     (
     Len(ActionComboBoxName.Selected.Value) = 0 ||
     ActionComboBoxName.SelectedItems in Action.Value
     ) &&
     (
     Len(ProjectComboBoxName.Selected.Value) = 0 ||
     ProjectComboBoxName.SelectedItems in 'Project Actioned'.Value
     )
     )
     },
     SortByColumns(
     Search(
     AddColumns(
     wList,
     "StatusVal", 
     Status.Value, 
     "DepInChargeVal", 
     'Department in Charge'.Value,
     "ProductVal", 
     Product.Value, 
     "ComponentVal", 
     Component.Value, 
     "SubAssemVal", 
     'Sub Assembly'.Value, 
     "RaisedByVal", 
     'Raised By'.DisplayName, 
     "WhoVal", 
     Who.DisplayName
     ),
     ECR_IssueFilterInput.Text, 
     "ECR_ID", 
     "ACT_ID",
     "Title", 
     "Comments", 
     "StatusVal", 
     "ChangeDone", 
     "DepInChargeVal", 
     "ProductVal", 
     "ComponentVal", 
     "SubAssemVal", 
     "RaisedByVal", 
     "WhoVal"
     ),
     "ECR_ID", 
     If(
     ECRIDSortOrder = Ascending, 
     Ascending, 
     Descending
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Clemented Profile Picture
    30 on at

    Hey Warren,

     

    Sorry but I've realised I've worded my original question in a way that makes it seem like actioned on and project actioned are being selected from combo boxes during filtering. I meant that during submission of a form, project and actioned on are being selected from a multi-choice combo-box which is causing issues with my search function. Filtering is all being done through one text search box.

     

    Clemented_0-1665978891447.png

     

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @Clemented ,

     A bit confused - what is the difference between during submission of a form, project and actioned on are being selected from a multi-choice combo-box and what I posted and are these fields then filtered further ?

  • Clemented Profile Picture
    30 on at

    Hey Warren,

    To me, this 

    ECR, 
     (
     Len(ActionComboBoxName.Selected.Value) = 0 ||
     ActionComboBoxName.SelectedItems in Action.Value
     ) &&
     (
     Len(ProjectComboBoxName.Selected.Value) = 0 ||
     ProjectComboBoxName.SelectedItems in 'Project Actioned'.Value

     looks like you're first filtering the output based on the value selected in a combobox(s). I don't have any combo-boxes filtering my output, just a search bar. Am I reading your code incorrectly? 

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @Clemented ,

    You referenced This approach doesn't seem to work with multiple selection combo boxes - are you actually referring to Multi-select field values ? If so

    SortByColumns(
     Filter( 
     Search(
     AddColumns(
     wList,
     "StatusVal", 
     Status.Value, 
     "DepInChargeVal", 
     'Department in Charge'.Value,
     "ProductVal", 
     Product.Value, 
     "ComponentVal", 
     Component.Value, 
     "SubAssemVal", 
     'Sub Assembly'.Value, 
     "RaisedByVal", 
     'Raised By'.DisplayName, 
     "WhoVal", 
     Who.DisplayName
     ),
     ECR_IssueFilterInput.Text, 
     "ECR_ID", 
     "ACT_ID",
     "Title", 
     "Comments", 
     "StatusVal", 
     "ChangeDone", 
     "DepInChargeVal", 
     "ProductVal", 
     "ComponentVal", 
     "SubAssemVal", 
     "RaisedByVal", 
     "WhoVal"
     ),
     ECR_IssueFilterInput.Text in Action.Value ||
     ECR_IssueFilterInput.Text in 'Project Actioned'.Value
     ),
     "ECR_ID", 
     If(
     ECRIDSortOrder = Ascending, 
     Ascending, 
     Descending
     ) 
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Clemented Profile Picture
    30 on at

    Hey Warren,

     

    Yep that's exactly what I mean sorry. I've implemented your code but it isn't displaying anything in my datatable. 

     

    Clemented_0-1666232027822.png

    Clemented_1-1666232049392.png

    Clemented_2-1666232107275.png

     

     

  • Verified answer
    WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @Clemented ,

    There are times you can simply get too complex with filters - this may be one of them, but try this

    With(
     {
     wList:
     SortByColumns(
     Search(
     AddColumns(
     wList,
     "StatusVal", 
     Status.Value, 
     "DepInChargeVal", 
     'Department in Charge'.Value,
     "ProductVal", 
     Product.Value, 
     "ComponentVal", 
     Component.Value, 
     "SubAssemVal", 
     'Sub Assembly'.Value, 
     "RaisedByVal", 
     'Raised By'.DisplayName, 
     "WhoVal", 
     Who.DisplayName
     ),
     ECR_IssueFilterInput.Text, 
     "ECR_ID", 
     "ACT_ID",
     "Title", 
     "Comments", 
     "StatusVal", 
     "ChangeDone", 
     "DepInChargeVal", 
     "ProductVal", 
     "ComponentVal", 
     "SubAssemVal", 
     "RaisedByVal", 
     "WhoVal"
     ),
     "ECR_ID", 
     If(
     ECRIDSortOrder = Ascending, 
     Ascending, 
     Descending
     ) 
     )
     },
     Filter(
     wList,
     Len(ECR_IssueFilterInput.Text) = 0 ||
     (
     ECR_IssueFilterInput.Text in Action.Value ||
     ECR_IssueFilterInput.Text in 'Project Actioned'.Value
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Clemented Profile Picture
    30 on at

    That's fair enough Warren. I couldn't get this version working either so I'm happy to leave it there and perhaps rethink my approach based on some other posts I've seen floating around the forums. 

     

    Thanks for the help 🙂 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard