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 / Define multiple ForAll...
Power Apps
Unanswered

Define multiple ForAll to overcome the in operation delegation inside SharePoint

(0) ShareShare
ReportReport
Posted on by 2,098 Season of Giving Solutions 2025

For a combobox i have this formula inside its items property:-

 

Distinct(With(
 {
 _Forms:
 Distinct(
 colRelatedPostingUnPostingForms, 
 'Location Name'
 ),
 _Select:
 Filter(
 Locations,
 StreetTitleSync in PostingFormStreetComboBox_1.SelectedItems
 )
 },
 Ungroup(
 ForAll(
 _Forms As _Post,
 Filter(
 _Select,
 Title in _Post.Value
 )
 ),
 "Value"
 )
),Title)

 

now can i issue many delegable queries to sharepoint to build a collection inside a ForAll to mimic the in operator ? i know the collection can only hold up to 2000 items, but atleast the 2000 items will be matching the critiria i am defining to get the items

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

    @johnjohnPter ,

    As I supplied most of that code in an earlier thread, I will try to answer your question. Firstly, it is not a total "magic bullet" as although _Forms will work properly (it is filtering a collection, so has to be under your limit), _Select uses the in Operator and is therefore subject to Delegation limits. The bottom Ungroup and the Distinct are operating locally on the output of the With statement two items, therefore are already under your Delegation limit.

    The only way to build a collection over your limit is generally in stages (adding to the earlier set) - ForAll itself creates a Table which is also subject to Delegation limits so is not useful here.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • johnjohnPter Profile Picture
    2,098 Season of Giving Solutions 2025 on at

    @WarrenBelz but if i rewrite this query:-

     

     

     

    Filter(
     Locations,
     StreetTitleSync in PostingFormStreetComboBox_1.SelectedItems
     )

     

     

     

    to be:-

     

     

     

    ForAll(PostingFormStreetComboBox_1.SelectedItems As s, Collect(TempCollection,
    Filter(
     Locations,
     StreetTitleSync = s.Value
     )
    )

     

     

     

    so i will have TempCollection collection containing max of 2,000 locations that are under the streets selected inside the combobox.. unlike using in operator which  might not get all the locations that are under the streets i am selecting inside the combobox (if the location sharepoint list contain more than 2000 items -which is the case at my end-).. is my assumption correct? and still i am unsure how i can define ForAll inside the with statemnt?

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

    @johnjohnPter ,

    Yes you are correct that the Delegable filter inside the ForAll(Collect) will address the entire data source (it is Delegable) in each itineration of ForAll.

    ForAll(
     PostingFormStreetComboBox_1.SelectedItems As s, 
     Collect(
     TempCollection,
     Filter(
     Locations,
     StreetTitleSync = s.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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

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 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard