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 / Filtering data table c...
Power Apps
Unanswered

Filtering data table column where entries originate from a combo box

(0) ShareShare
ReportReport
Posted on by 30

Hello,

 

I'm creating an issue register canvas app where one column shows the project number(s) that a particular issue could impact. I would like to filter my data table by project number based on a dropdown box.

 

Example of data table columnExample of data table column

I tried filtering with the following code, however I ran into the issue of the column entry values being tables and the dropdown entry values being text and thus incompatible for searching. I thought that perhaps I could search for each index within the table though I'm not sure how to do this in PowerApps. 

 

 

('Project No'.Value = ProjectNumberFilterInput.Selected.Value || ProjectNumberFilterInput.Selected.Value = Blank())

 

 

My second approach was to convert each column entry to a string and then filter them with the StartsWith() function. Although this works, project numbers can be entered in any order and thus only entries that start with the project number entered in the filter box will be let through the filter. i.e. in the case of the above screenshot, selecting J108300 would not display the first, second, and third entries. 

 

 

StartsWith(Concat('Project No', Value, ", "), Text(ProjectNumberFilterInput.Selected.Value))

 

 

This approach also causes delegation issues which disqualifies it and so I didn't spend any additional time refining it. 

 

Any ideas?

 

Categories:
I have the same question (0)
  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    Hi @Clemented 

    it could be the way you have written your filter, try like the following 

    Filter(Datasource, 
    Column = ProjectNumberFilterInput.Selected.Value || ProjectNumberFilterInput.Selected.Value = Blank())

     

  • WarrenBelz Profile Picture
    155,344 Most Valuable Professional on at

    Hi @Clemented ,

    You cannot avoid Delegation issues entirely as you need the in filter.

    ('Project No'.Value in ProjectNumberFilterInput.SelectedItems || ProjectNumberFilterInput.Selected.Value = Blank())

    Can you please include your complete Filter code (in Text) and I will see what workaround may be possible. The below may not be a magic bullet (there is still some Delegation limitation), but try it

    If(
     Len(ProjectNumberFilterInput.Value) = 0,
     YourSPListName,
     Ungroup(
     ForAll(
     ProjectNumberFilterInput.SelectedItems As aSel,
     Filter(
     YourSPListName,
     'Project No'.Value = aSel.Value
     )
     ),
     "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

    Hey Warren,

    Here's my full filter code

    SortByColumns(
     Filter([@NCR], StartsWith(Title, IssueFilterInput.Text) 
     && StartsWith('NCR _ID', Concatenate("NCR_", Text(Value((NCR_ID_FilterInput.Text)), "0000")))
     //&& ('Project No'.Value = ProjectNumberFilterInput.Selected.Value || ProjectNumberFilterInput.Selected.Value = Blank())
     //&& StartsWith(Concat('Project No', Value, ", "), Text(ProjectNumberFilterInput.Selected.Value))
     && (Status.Value = StatusFilterInput.Selected.Value || StatusFilterInput.Selected.Value = Blank())
     && ('Department In Charge'.Value = DepartmentFilterInput.Selected.Value || DepartmentFilterInput.Selected.Value = Blank())
     && StartsWith('Raised By'.DisplayName, RaisedByFilterInput.Text)
     && (Product.Value = ProductFilterInput.Selected.Value || ProductFilterInput.Selected.Value = Blank()) // Allowing a user to select multiple product types is causing issues
     ), 
     "NCR_ID",
     If(NCRIDSortOrder = Ascending, Ascending, Descending))

    The lines which are commented out are my two proposed solutions. Thankyou for your quick response 🙂 

  • WarrenBelz Profile Picture
    155,344 Most Valuable Professional on at

    Hi @Clemented ,

    Firstly, I am not sure what you are doing with the Concat field (so I have not altered it other than to use AddColumns), but the only way you are going to get this rather complex filter to have any chance of a Delegable result is this structure. Note the first With() statement is to "put the work" outside the filter, the second it to allow the bottom filter to operate locally and not be subject to Delegation, but note that the second With() filter needs to return record numbers under your Delegation limit for all of this to fully work.

    With(
     {
     wNCR:
     "NCR_" & 
     Text(
     Value(NCR_ID_FilterInput.Text), 
     "0000"
     )
     },
     With(
     {
     wList:
     SortByColumns(
     Filter([@NCR],
     StartsWith(
     Title, 
     IssueFilterInput.Text
     ) && 
     StartsWith(
     'NCR _ID', 
     wNCR
     ) && 
     (
     Status.Value = StatusFilterInput.Selected.Value || 
     StatusFilterInput.Selected.Value = Blank()
     ) && 
     (
     'Department In Charge'.Value = DepartmentFilterInput.Selected.Value || 
     DepartmentFilterInput.Selected.Value = Blank()
     ) && 
     StartsWith(
     'Raised By'.DisplayName, 
     RaisedByFilterInput.Text
     )
     ),
     "NCR_ID",
     If(
     NCRIDSortOrder = Ascending, 
     Ascending, 
     Descending
     )
     )
     },
     Filter(
     AddColumns(
     wList,
     "ProjNo",
     Concat(
     'Project No', 
     Value, 
     ", "
     )
     ),
     (
     ProductFilterInput.SelectedItems in Product.Value || 
     ProductFilterInput.Selected.Value = Blank()
     ) &&
     (
     ProjectNumberFilterInput.SelectedItems in 'Project No'.Value || 
     ProjectNumberFilterInput.Selected.Value = Blank()
     ) && 
     StartsWith(
     ProjNo, 
     Text(ProjectNumberFilterInput.Selected.Value)
     )
     )
     )
    )

    Note it is free-typed so watch commas/brackets etc.

     

    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,

    Thanks for taking the time to type up this behemoth, it is appreciated. I'm having an issue with data types when pasting it in but I'll take some time to sort that out when I have time and let you know how it goes.

    Clemented_0-1659929989861.png

     

    Cheers,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard