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 / Filter Powerapps galle...
Power Apps
Answered

Filter Powerapps gallery using delegable function.

(0) ShareShare
ReportReport
Posted on by

Hi folks ,

 

I have requirement please help to remove the delegation warning showing for "in" for this below Powerapps code wriiten on a gallery item property

 

Sort( Filter( Filter( SFB_User_Master, Flag= "Yes" ), Country_Col in varUserCheck ), ID, SortOrder.Ascending )

 

Where SharePoint list name " SFB_User_Master" having more than 13k records ,contains "User_name"(Single line of text)column,"Country_Col"(single line of text) & "Flag" (single line of text) column.

 

VarUserCheck : variable can contains more than 2 countries name .

Code for it , written OnVisible property of the screen 

Set( varUserCheck, Filter( Dev_SFB_User_Master, User_Email_ID = varloggedinUserEmail ).Country_Col );

 

VarloggedinUserEmailuser().email

 

Please help me to solve this issue.

 

Thanks in Advance.

 

 

 

Categories:
I have the same question (0)
  • Jonathan Manrique Profile Picture
    2,695 on at

    Hi @ParomitaDas2916 

     

    By default there are formulas that are delegatable and when you use it you will have the delegation warning.

    Perhaps the issue is to change the focus of the formula you are using a little to be able to skip the delegation and above all the fact that it will only return the first 2000 records.

    Understand delegation in a canvas app - Power Apps | Microsoft Learn

    I share this video that can help you a lot

     

    https://youtu.be/NJaHC5S9Cjo?si=MMQ35XM2Qjbg2aQ1

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    You can accept more than one post as a solution

     

     

  • ParomitaDas2916 Profile Picture
    on at

    Hello @Jmanriquerios , thanks for quick response.i will check it & get back to you .

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @ParomitaDas2916 ,

     

    Please try below formula:

     

    Sort(
     UnGroup(
     ForAll(
     varUserCheck As UC, 
     Filter(
     SFB_User_Master, 
     Flag= "Yes" && Country_Col = UC.Country_Col
     )
     ),
     "Value"
     ), 
     ID, 
     SortOrder.Ascending
    )

     

     

    Best regards,

  • ParomitaDas2916 Profile Picture
    on at

    Hi @v-jefferni , thanks for the code .If you could let me know what is value of "UC" here.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @ParomitaDas2916 ,

     

    The As operator is used in the formula for disambiguation. So, the UC is renamed from varUserCheck because it also has the Country_Col column.

     

    Best regards,

  • ParomitaDas2916 Profile Picture
    on at

    @v-jefferni  , it throwing error as

    'Ungroup' is a recognised but not supported function.

    The function ' sort' has some invalid arguments.

     

    Please share any other code.

     

    Thanks

     

     

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @ParomitaDas2916 ,

     

    Sorry, I wrote the formula by hand, it should be

    Sort(
     Ungroup(
     ForAll(
     varUserCheck As UC, 
     Filter(
     SFB_User_Master, 
     Flag= "Yes" && Country_Col = UC.Country_Col
     )
     ),
     "Value"
     ), 
     ID, 
     SortOrder.Ascending
    )

     

    Best regards,

  • ParomitaDas2916 Profile Picture
    on at

    Hello @v-jefferni  it is working now .🥳✨ Thanks for solving my issue.

  • ParomitaDas2916 Profile Picture
    on at

    Hi @v-jefferni ,sorry for the inconveniences.As I thought this code working fine with no delegation issues & retrieving 4000 showing last record ID 10999records based on filter by country .But after analysing the SharePoint datasource found that after 10999 there is more 1k records based on filter,which is not showing in the gallery.

     

    Please share me any other Code to resolve this issue .

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @ParomitaDas2916 ,

     

    I don't think there is other code. This formula is delegable so you shouldn't lose any entries. Since they're all Text columns, is it possible that some entries have flag/country values with trailing spaces that don't match the filters?

     

    Try below formula in items of a new Gallery, check if the last matching items show on the top of Gallery:

    With(
     {wFilter: Sort(Filter(SFB_User_Master, Flag= "Yes"), ID, SortOrder.Descending)},
     Sort(
     Ungroup(
     ForAll(
     varUserCheck As UC, 
     Filter(
     wFilter,
     Country_Col = UC.Country_Col
     )
     ),
     "Value"
     ), 
     ID, 
     SortOrder.Descending
     )
    )

     

    Best regards,

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 413

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
timl Profile Picture

timl 315 Super User 2026 Season 1

Last 30 days Overall leaderboard