Skip to main content

Notifications

Community site session details

Community site session details

Session Id : sjaVVSbx3ejHfRK5U84HZA
Power Apps - Building Power Apps
Answered

ClearCollect is Blank

Like (0) ShareShare
ReportReport
Posted on 23 Feb 2023 01:29:53 by 36

Hi all,

 

I'm using the following code on OnStart (App) to collect SP data since my list is greater than 2K. However, although PowerApps recognizes the new name "ViewAllRequests", the data is empty. RowID is a number column, copied from ID and I've indexed in SP. Maybe I need to wait for the Index to complete? There's no delegation or any other warnings with this code.

 

Concurrent(
ClearCollect(ViewRequestsA,Filter(Requests,RowID < 2000)),
ClearCollect(ViewRequestsB,Filter(Requests,RowID >= 2000 And RowID < 3000))

);
ClearCollect(ViewAllRequests,ViewRequestsA,ViewRequestsB);

Categories:
  • Robert_ Profile Picture
    36 on 25 Feb 2023 at 16:53:36
    Re: ClearCollect is Blank

    Thanks so much @Drrickryp ! Worked like a charm.

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on 23 Feb 2023 at 03:39:11
    Re: ClearCollect is Blank

    @Robert_

    Sorry, it should be

    Collect(ViewAllRequests, ViewRequestsA, Filter(ViewRequestsB, !(ID in ViewRequestsA.ID);

    Works for up to 4k records

    Using collections is not the answer to delegation in large datasets as the various workarounds will cause performance hits. Either use delegatable SharePoint functions and operators or move your data to Sql or Dataverse. 

  • Robert_ Profile Picture
    36 on 23 Feb 2023 at 01:59:50
    Re: ClearCollect is Blank

    Thanks. I get an error on the last ClearCollect:

    Invalid schema, Expected a one-column table

     

    I still do not understand why my first code did not work. What happens when I get to 5,000 rows? Why is the original clearcollect blank and is there a way I can backtrace the code to see what it's doing?

  • Robert_ Profile Picture
    36 on 23 Feb 2023 at 01:59:46
    Re: ClearCollect is Blank

    Thanks. I get an error on the last Collect:

    Invalid schema, Expected a one-column table

     

    I still do not understand why my first code did not work. What happens when I get to 5,000 rows? Why is the original clearcollect blank and is there a way I can backtrace the code to see what it's doing?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 23 Feb 2023 at 01:41:41
    Re: ClearCollect is Blank

    @Robert_

    Concurrent(
    ClearCollect(ViewRequestsA,Sort(Requests, ID, Ascending), 
    ClearCollect(ViewRequestsB,Sort(Requests,ID, Descending)); 

    Collect(ViewAllRequests,Filter (ViewRequestsA,!(ViewRequestsB in ViewRequestsA);

    Works for up to 4k records. 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,089 Most Valuable Professional

Leaderboard