cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter On data source connection

Hi all,

 

I am trying to connect to a SharePoint list and filter by user().email=person.email()

Filter('Active Field Leadership', 'Performed By'.Email=User().Email)

 

I previously had it wrapped in a Sort by columns  function

SortByColumns(Filter('Active Field Leadership', 'Performed By'.Email=User().Email), "Date", SortOrder.Descending)

 

i have been using a filter() query in my browse screen, but I think it has maxed out on the number of entries in the list.

How can I create a connection to the list that only pulls the list items of the user, rather than pulling all items and trying to filter?

30 REPLIES 30
Anonymous
Not applicable

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.

 

😞

 

 

Um, would you mind sharing a screenshot?

 

Thanks, 

Anonymous
Not applicable

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)))

 

Hey @Anonymous 

 

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!

Anonymous
Not applicable

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)))

 

Hey @Anonymous 

 

Glad that I worked! Code 2 will handle the scenarios where record limit crosses the 2000 threshold.
 
Thanks, 
Anonymous
Not applicable

Code 1 did not pull more than 500 records.

Did I do something wrong?

Hey @Anonymous 

 

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
Anonymous
Not applicable

No records, just a heading

Hey @Anonymous 

 

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,620)