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 / Powerapps Concurrent c...
Power Apps
Answered

Powerapps Concurrent collection

(0) ShareShare
ReportReport
Posted on by 45

Hi,

 

i'm building a collection from Azure SQL table. The table has more than 4000 records, so I am building a main collection by filtering on a row id. when i do a countrows on the collection i get 4000. but, when i view the collection in a gallery i see empty records apart from the row id column which is visible.

 

my code:

 

Concurrent (
ClearCollect(
colConc1,
Filter(
'espo.filter_set_attributes',
row_id <= 2000
)
),
ClearCollect(
colConc2,
Filter(
'espo.filter_set_attributes',
row_id > 2000 And row_id <= 4000
)
)
);
ClearCollect(
colAttrEspo,
colConc1,
colConc2
);

 

any ideas what might be wrong or is there another way to get the same desired result?

 

Mukesh

Categories:
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    I'm thinking its likely that you arent using any of the other columns anywhere else yet, so explicit column selection is only bringing back the columns it thinks you need. You could wrap your datasource in a ShowColumns() to bring back the exact columns you want or else turn off explicit column selection option in the app's settings (although this will be made a permanent setting at some point in the near future so its better to get used to using ShowColumns).

     

    Concurrent(
     ClearCollect(
     colConc1,
     Filter(
     ShowColumns('espo.filter_set_attributes', "row_id", "ColumnName2", "ColumnName3")
     ,
     row_id <= 2000
     )
     ),
     ClearCollect(
     colConc2,
     Filter(
     ShowColumns('espo.filter_set_attributes', "row_id", "ColumnName2", "ColumnName3")
     ,
     row_id > 2000 And row_id <= 4000
     )
     )
    );
    ClearCollect(
     colAttrEspo,
     colConc1,
     colConc2
    );

     

  • timl Profile Picture
    37,420 Super User 2026 Season 2 on at

    @mukeshkavia - @iAm_ManCat's reply is spot on, and the correct answer.

     

    The comment I would add is that collecting 1000's of records into a local collection is slow and not efficient. Whilst this technique may be common, particularly against SharePoint data sources, SQL Server is a highly delegable data source and in the vast majority of cases, there are alternative formulas/techniques you can use that are far more efficient.

  • mukeshkavia Profile Picture
    45 on at

    Hi,

    Thank you for your tip.

    So, i've added in the ShowColumns function and i'm only getting back 2000 records? i'd expect 4000

     

    Concurrent (
    ClearCollect(
    colConc1,
    Filter(ShowColumns(
    'espo.filter_set_attributes',"customer_account","default_route_no","department","division","funding_body","geography","post_code_sector","row_id","s21_priority","service_level"),
    row_id <= 2000
    )
    ),
    ClearCollect(
    colConc2,
    Filter(
    ShowColumns(
    'espo.filter_set_attributes',"customer_account","default_route_no","department","division","funding_body","geography","post_code_sector","row_id","s21_priority","service_level"),
    row_id > 2000 And row_id <= 4000
    )
    )
    );
    ClearCollect(
    colAttrEspo,
    colConc1,
    colConc2
    );

  • mukeshkavia Profile Picture
    45 on at

    Hi,

    Thanks for your reply. What are the alternative methods for getting more than 2000 records into powerapps from SQL? I've generally had no issues to date using concurrent over collections, but, for some reason this is now not working.

    Thanks

    Mukesh

  • timl Profile Picture
    37,420 Super User 2026 Season 2 on at

    Hi @mukeshkavia 

    The question is - why do you want to get more than 2000 records into your app from SQL?

    For instance, if you add a gallery control and set the items property to espo.filter_set_attributes, the gallery will show all records (including those beyond row 2000) as the user scrolls through the gallery. Likewise, if you were to add a combo box and set the items property to espo.filter_set_attributes, the user will be able to search through all records in the table.

    Is there a specific use case that requires you to preload all the contents of the table into a collection?

  • Verified answer
    mukeshkavia Profile Picture
    45 on at

    Hi,

    You're not able to view more than 2000 records as a default.

    I've found that if i use the below code, i'm able to pull back all the records i need. These removes the need for concurrent function which was the issue.

    thanks

     

    ClearCollect(
    colAttrEspo,
    Filter(
    'espo.filter_set_attributes_original',
    row_id <= 2000
    ),
    Filter(
    'espo.filter_set_attributes_original',
    row_id > 2000 And row_id <= 4000
    )
    );

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

    @mukeshkavia ,

    I will add a small contribution - if you want to collect all items in a list and you have a unique sequential identifier such as your row_id, this will do it, but be aware the bigger the list, the longer it will take to run. I assume here you have your Delegation limit set to 2,000

    Clear(colAttrEspo);
    With(
     {
     wSets: 
     With(
     {
     wLimits: 
     With(
     {
     wLimit: 
     Sort(
     'espo.filter_set_attributes',
     row_id,
     Descending
     )
     },
     RoundDown(
     First(wLimit).row_id / 2000,
     0
     ) + 1
     )
     },
     AddColumns(
     RenameColumns(
     Sequence(
     wLimits,
     0,
     2000
     ),
     "Value",
     "LowID"
     ),
     "HighID",
     LowID + 2000
     )
     )
     },
     ForAll(
     wSets As MaxMin,
     Collect(
     colAttrEspo,
     Filter(
     'espo.filter_set_attributes',
     row_id > MaxMin.LowID && row_id <= MaxMin.HighID
     )
     )
     )
    )
  • mukeshkavia Profile Picture
    45 on at

    Thanks Warren, yes I have delegation set to 2000. speed is not an issue so far, but I will bear this in mind.

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

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard