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 / How to make this deleg...
Power Apps
Unanswered

How to make this delegable?

(1) ShareShare
ReportReport
Posted on by 2
I want a user to be able to select and apply multiple tags to a search. For example, if they choose tags "Software" and "Communications" the gallery should only show a list of items that have both the tags software AND communications. This is connected to dataverse. Tags is a multi‑select Choice column
 
With(
    {
        base: Search(
            Filter(
                TrainingModules,
                IsBlank(mediaTypeSearchBox.Selected) || MediaType = mediaTypeSearchBox.Selected.Value,
                'Avg Rating' >= varMin / 2 && 'Avg Rating' <= varMax / 2,
        // Note: Delegation Issue. More than 2k Training Modules will lead to search issues.
                IsEmpty(tagSearchBox.SelectedItems) || !(false in ForAll(
                    tagSearchBox.SelectedItems,
                    ThisRecord.Value in Tags.Value
                ))
            ),
            searchQuery,
            'Module Title',
            Description
        )
    },
//Apply the additional filters to the already searched list
    Switch(
        filteringResults.Selected.Value,
        "Newest",
        SortByColumns(
            base,
            "createdon",
            SortOrder.Descending
        ),
        "Top Rated",
        SortByColumns(
            base,
            "jsc_avgrating",
            SortOrder.Descending
        ),
        base
    )
)
I have the same question (0)
  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at
    Try this for a start - I assume you are using SharePoint as a data source. Also not sure if the many-to-many filter will give you what you want - if you need anything that matches anything selected in the Combo Box, you need the below.
    With(
       {
          base: 
          Filter(
             TrainingModules,
             Len(mediaTypeSearchBox.Selected.Value) - 0 || MediaType = mediaTypeSearchBox.Selected.Value,
             'Avg Rating' >= varMin / 2 && 'Avg Rating' <= varMax / 2
          ),
          _Sort:
          Switch(
             filteringResults.Selected.Value,
             "Newest",
             "createdon",
             "Top Rated",
             "jsc_avgrating"
          )
       },
       Search(
          SortByColumns,
             Filter(
                base,
                IsEmpty(tagSearchBox.SelectedItems) || 
                true in 
                ForAll(
                   tagSearchBox.SelectedItems,
                   ThisRecord.Value in Tags.Value
                )
             ),
             _Sort,
             SortOrder.Descending
          ),
          searchQuery,
          'Module Title',
          Description
       )
    )
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • EG-03031724-0 Profile Picture
    2 on at
    I tried this. Which got rid of the delegation warning but is still non-delegable and did not resolve the issue. Also I am using Dataverse, ands tags is a multi-select choice column. 
     
    With(
       {
          base:
          Filter(
             TrainingModules,
             IsBlank(mediaTypeSearchBox.Selected) || MediaType = mediaTypeSearchBox.Selected.Value,
             'Avg Rating' >= varMin / 2 && 'Avg Rating' <= varMax / 2
          )
       },
       With({
        searched:
       Search(
             Filter(
                base,
                 IsEmpty(tagSearchBox.SelectedItems) ||
    CountIf(
             tagSearchBox.SelectedItems As s,
             !IsBlank( LookUp( Tags, Value = s.Value ) )
           )
           = CountRows(tagSearchBox.SelectedItems)
     
             ),
          searchQuery,
          'Module Title',
          Description
       )
    },
    Switch(
            filteringResults.Selected.Value,
            "Newest",
            SortByColumns(
                searched,
                "createdon",
                SortOrder.Descending
            ),
            "Top Rated",
            SortByColumns(
                searched,
                "jsc_avgrating",
                SortOrder.Descending
            ),
            searched
        )
    )
    )
  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at
    I need to clarify what you mean by  is still non-delegable and did not resolve the issue
     
    If you are saying that it does not return the full data set required, then that is certainly possible as the structure I posted relies on the top filter on 'Avg Rating' returning record numbers under your (500 - 2,000) Data Row Limit
     
    Your problem is that many-to-many filters using either CountRows or CountIf and to some extent ForAll are all "local" functions are are not able to be Delegated by either SharePoint or Dataverse. The other issue is that With itself is a local variable - you can run anything Delegable inside it, but ultimately the output is limit to 2,000 records (so in effect a Delegation limitation) - although you can use it for "pre-defining" things you use on a Delegable filter.
     
    Before I look at this further (they may be scope for improvement now I know you are using Dataverse), what exactly (your desired result) are you trying to achieve with this
    CountIf(
       tagSearchBox.SelectedItems As s,
       !IsBlank( 
          LookUp( 
             Tags, 
             Value = s.Value 
          ) 
       )
    ) = CountRows(tagSearchBox.SelectedItems)
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 84

#2
WarrenBelz Profile Picture

WarrenBelz 79 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 40 Super User 2026 Season 1

Last 30 days Overall leaderboard