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 a Gallery no...
Power Apps
Answered

Filtering a Gallery not returning correct results

(1) ShareShare
ReportReport
Posted on by

I have a gallery built off a Sharepoint list "Suppliers" as follows : 

Powertron_0-1681466947514.png

Powertron_6-1681466992656.png

 

 

The "Suppliers" button feeds the current gallery item into a variable : 

Powertron_1-1681466947344.png

 

This is used by a second table which is fed from the "Supplier Contacts" table:

Powertron_4-1681466947364.png

This is supposed to use the SupplierID value to select all the supplier contacts for each supplier, when I click the "Suppliers" button.  

 

There is a text box at the top of my second gallery that indicates the Supplier Name and the number of Contacts the supplier has, and that illustrates the issue I'm having : 

 

Powertron_2-1681466947386.png

 

So the first part works fine, the supplier name is contained in my "Suppliers" list and is collected into the "colSuppliers" collection, from which it is correctly identified.

 

The issue is the second part.  This particular supplier has 4 contacts, as you can see its listing one.  It IS listing one of the 4 contacts which are assigned to this supplier in my gallery, but not the other 3.

 

This only lists one of the four entries in the colSupplierContact list, and I cannot for the life of me work out why.

 

From the code I can see it correctly knows that the varSupplierContact.SupplierID value is 62 : 

Powertron_5-1681466947479.png

 

So I can't figure out why this isn't working.

Categories:
  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Hi @Powertron,

     

    If you hover over the code with the blue underline [Value(SupplierId.Value) =], what does the warning show?

    Also, what is the app's data row limit?

    More info on how to find this here: https://powerapps.microsoft.com/fr-be/blog/powerapps-data-row-limit-for-non-delegable-queries/

     

    Checking in case this warning is related to why limited data is returned - for example, if there's a delegation issue and only one record is returned.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • Powertron Profile Picture
    on at

    Hi Keith,

     

    There is indeed a delegation issue, I used the code in the screenshot above just for ease of explaining.  I am clear collecting the Sharepoint list into a collection on page load : 

    Powertron_0-1681468112738.png

    And basing the code on that : 

    Powertron_1-1681468141128.png

    I'm not sure whether this would completely eliminate the delegation/data limit issue or whether I'd need to do something else to load all data from the Sharepoint list.

     

    My Sharepoint list contains around 700 entries, so might be above the default 500 limit.

  • Verified answer
    KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Thanks @Powertron. Good to know about the ClearCollect() call, although delegation issues may potentially still be the root cause.

     

    For example, if your app's data row limit is 1000 then that ClearCollect() may be collecting the first 1000 rows from the SharePoint list.

     

    So, if your SupplierId 62 records are rows #100, #1010, #1011, #1012, then it may be the case that only row #100 is being collected and the other rows are not available.

     

    Out of interest, what is the app's data row limit?

    More info on how to find this here: https://powerapps.microsoft.com/fr-be/blog/powerapps-data-row-limit-for-non-delegable-queries/


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • Powertron Profile Picture
    on at

    Hi Keith,

     

    Thanks for the assist, I figured out this was data related, as I added the following code to the "Contacts" button of my Suppliers list: 

    Powertron_0-1681470097685.png

    This clear collects the list based on the filter and is returning the correct values.

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    My pleasure. Well done on fixing the issue, and thanks for the update.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard