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
yashag2255
Dual Super User II
Dual Super User II

Hi @Anonymous 
 
The Filter query, looks for the records matching the condition  provided and only fetches those records which satisfies it rather than pulling all the records. 
 
What is the approximate total number of records associated with each user in the sharepoint list? Can you please share more details, so that we can help you better.
 
Thanks, 
Anonymous
Not applicable

Probably around 10-20 per user at the moment, but we have around 150 users. I have this in the browse gallery at the moment. Is there a better place to use this function?
 
It looks as if it is pulling older records, but not the newest ones.

Hi @Anonymous 

 

Can you try this: Refresh the data source using Refresh(<<DataSource>>) and sort the returned results based on Last Modified attibute to get the newly created ones?
 
Thanks, 
Anonymous
Not applicable

I tried using refresh() in two places

- App -> Action -> On start

- BrowseGallery1 -> Data -> Items (as part of my existing query above )

 

Taking ages to load and still only getting older items.

I checked and my ahrepoint list currently has 891 entries.

 

Any other ideas, or should I try the refresh somewhere else?

Hi @Anonymous , 

 

Kindly check that the Data Row limit for Non-Delegable queries is set to 2000, this is the max value that can be entered by the user and works upto 2000 records out of all using the Filter query. The soft limit is 500 which can be updated to 2000 records.

 

Settings:

Navigate to File -> App Settings -> Advanced Settings -> Look for Data Row limit for Non-Delegable queries

 

Hope this helps!

Anonymous
Not applicable

Yes, I have tried this. It will give me my 17 current list items, but what happens when the full list exceeds 2000.

Hi @Anonymous , 

 

In that case you can use collections: 

 

If you more than 2000 records and want to use a local collection then follow below steps:

a) We will use the ID field to get the records

b) create a collection to store the number of loop count:

ClearCollect(LoopCount,FirstN([0, 2000, 4000, 6000, 8000, 10000],RoundUp(First(Sort(<<YourSPList>>,ID,Descending)).ID/2000,0)));

c) Now work on the main collection to get all the data, this can be done through OnVisible property of the page.

Clear(ListItems);

ForAll(LoopCount,Collect(ListItems,Filter(<<Sp LIST>>,ID> Value)));

d) Once all the data is inside the collection, filter out the gallery items based on the collection created using the same formula rather than referring to the data source directly.

 

Hope this Helps!

Anonymous
Not applicable

Ok, I have tried this in

-> App ->Action ->On Start

AND ->BrowseGallery1->Action->OnVisable

 

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

 

All I get is collections with no records...what am doing wrong?

Hi @Anonymous 

 

This might be beacause you removed the condition for looping. 
What data are you getting inside the LoopCount collection?
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)))
Also, do a right click on the App Start and select run AppStart. I am assuming you have increased the soft limit of 500 to 2000 in the App Settings as mentioned in my previous responses. 
 
Hope this Helps!

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