cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NicolaNeedsHelp
Level: Powered On

Re: Filter On data source connection

I copied the code directly.

 

I am not getting any data in the Loopcount collection. And I can still only see the first entered list items.

 

😞

 

 

Dual Super User
Dual Super User

Re: Filter On data source connection

Um, would you mind sharing a screenshot?

 

Thanks, 

NicolaNeedsHelp
Level: Powered On

Re: Filter On data source connection

I saved and published and it worked for all list items.

I am not totally convinced it will work when the list goes past 2000 items.

 

Is there a way I can test with only 800 items, using the setting of pulling 500.

Something like this?

 

ClearCollect(LoopCount,FirstN([0,500, 1000, 1500, 2000],RoundUp(First(Sort('Active Field Leadership',ID,Descending)).ID/500,0))); Clear(ListItems); ForAll(LoopCount,Collect(ListItems,Filter('Active Field Leadership','Performed By'.Email=User().Email && ID > Value)))

 

Dual Super User
Dual Super User

Re: Filter On data source connection

Hey @NicolaNeedsHelp 

 

In that case, set your Data Row Limit for Delegation to 500, so it will fetch only first 500 recods at a time.

expression:
ClearCollect(LoopCount,FirstN([0,500, 1000, 1500, 2000],RoundUp(First(Sort('Active Field Leadership',ID,Descending)).ID/500,0)));
Clear(ListItems);
ForAll(LoopCount,Collect(ListItems,Filter('Active Field Leadership','Performed By'.Email=User().Email && ID > Value)))

else,
If you don't want to modify the data delegation limit, please use below expression:
ClearCollect(LoopCount,FirstN([0,500, 1000, 1500, 2000],RoundUp(First(Sort('Active Field Leadership',ID,Descending)).ID/500,0))); Clear(ListItems); ForAll(LoopCount,Collect(ListItems,Filter('Active Field Leadership','Performed By'.Email=User().Email && ID > Value && ID <= Value + 500)))

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

NicolaNeedsHelp
Level: Powered On

Re: Filter On data source connection

Firstly, thank you so much for all your help so far.

 

I have attached some screen shots.

View 1 and Code 1 set with 500 limit. View 2 and Code 2 with 2000 limit.

Just trying to make sure I dont have to revisit it all when the list goes beyond 2000 entries.

 

Code 2

ClearCollect(LoopCount,FirstN([0,2000,4000,6000,8000,10000],RoundUp(First(Sort('Active Field Leadership',ID,Descending)).ID/2000,0)));
Clear(ListItems);
ForAll(LoopCount,Collect(ListItems,Filter('Active Field Leadership','Performed By'.Email=User().Email && ID > Value)))

 

Dual Super User
Dual Super User

Re: Filter On data source connection

Hey @NicolaNeedsHelp 

 

Glad that I worked! Code 2 will handle the scenarios where record limit crosses the 2000 threshold.
 
Thanks, 
NicolaNeedsHelp
Level: Powered On

Re: Filter On data source connection

Code 1 did not pull more than 500 records.

Did I do something wrong?

Dual Super User
Dual Super User

Re: Filter On data source connection

Hey @NicolaNeedsHelp 

 

Please share the screenshot of Loopcount collection. This will help us to get the number of iterations that will be performed.
 
Steps: Select View in the top navigation, then go to collections, when collection list appears, select loopcount and then on the right side, you can see the data into your collection.
 
Thanks
NicolaNeedsHelp
Level: Powered On

Re: Filter On data source connection

No records, just a heading

Dual Super User
Dual Super User

Re: Filter On data source connection

Hey @NicolaNeedsHelp 

 

As your loopcount collection contains a single record i.e. 0 that is why it is running just once, and fetching first 500 records, Can you please do a little test and share of the output of this expression: First(Sort('Active Field Leadership',ID,Descending)).ID
Put this expression on a label text and you will be able to see the results.
 
Thanks, 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Users Online
Currently online: 345 members 6,669 guests
Please welcome our newest community members: