cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Galina73
Helper V
Helper V

Need to filter sourde table by user

Hello,

I created an apps and connected SP list as a table. In this SP list  there is a user. I need to filter this table, if user in the SAp list is equal to current user.

 

Please,help

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Please clarify, are you getting 1 instead of 4 records, if so then delegation issues raised by my colleagues could be the issue.

 

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution

View solution in original post

Hi @Galina73 ,

1)If your person field is not a multiple person field, then you could use "=" instead of "in" in your formula.

What's more, "=" is delegatleable in sharepoint.

So you do not need to use collection in this situation.

Just use this formula:

Filter(ППР, User().Email =  'Личный кабинет'.Email)

 

2)Collection has record number limit not delegation limit.

So the latest problem is about collection limit, not delegation limit.

Could you tell me how many records in your list?

Actually, collection could save more than 10 000 record, it should not have problems unless your data is too large.

I suggest you split your list into several collections.

Try this kind of problem:

ClearCollect(collection1,Filter(ППР,ID<=10000));
ClearCollect(collection2,Filter(ППР,ID>10000,ID<=20000));
ClearCollect(collection3,Filter(ППР,ID>20000,ID<=30000));
.....

 Then filter them one by one:

Filter(Collection1,User().Email in 'Личный кабинет'.Email);
Filter(Collection2,User().Email in 'Личный кабинет'.Email);
Filter(Collection3,User().Email in 'Личный кабинет'.Email);
.....

What's more, please notice that you could only check the first five records in collection page.

366.PNG

 

You need to check other records of the collection in a gallery or list box.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
eka24
Super User
Super User

Filter(YourSPList,UsernameColume=User().FullName)
Pranav_Shroti
Kudo Collector
Kudo Collector

Well you have multiple options available - FILTER, SEARCH etc. You have now specified the exact scenario, hence cannot reproduce it at my end and provide the exact solution. 

 

Depending on your situation you can use the best possible method. Details - https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

 

Hope this helps,

Pranav

 

v-yutliu-msft
Community Support
Community Support

Hi @Galina73 ,

Do you want to filter your list based on current user?

Could you tell me user field's data type?

I assume that it is a person data type field.

Then try this formula:

Filter(listname,User().Email in userfield.Email)

 //please replace with your user field name

User().Email means current user's Email.

userfield.Email means that the Email addresses of the user field.

 

If you want to filter items that only has current user's email, you could also try this:

Filter(listname,User().Email = userfield.Email)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It works now, but returns only the firsr record in the list, while I need to see all records

Hi @Galina73 ,

Could you tell me:
1)user field's data type?

2)the formula that you use?

Did you use LookUp function?

LookUp function only returns the first record that meets the requirement.

I suggest you use Filter function, which will return all the records that meet the requirement.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

User field data type is User or Group

Formula is

 

Filter(ППР, User().Email in  'Личный кабинет'.Email)

 

ППР- list

'Личный кабинет'- user field in a list

 

Hi @Galina73 ,

Do you have delegation warning like this?

3308.PNG

 

If so, what you met should be a delegation problem.

If not, could you tell me you put your formula in which control's which property?

 

How to deal with deleagtion problem:

Does 'Личный кабинет' allow multiple choice?

3307.PNG

 If  'Личный кабинет' not allow multiple choice, it will be more easier.

Just use this formula :

Filter(ППР, User().Email =  'Личный кабинет'.Email)

 If  'Личный кабинет'  allows multiple choice, could you tell me how many records in your list?

If it is 500~2000, you just need to change the non-delegation limit to 2000:

delegation.jpg

 And you could still use this formula:

Filter(ППР, User().Email in  'Личный кабинет'.Email)

If your record number is more than 2000, it is a little complex.

"in" can not be delegated in powerapps when using sharepoint list as data source.

I suggest you save your list in collection and then filter based on this collection, because in collection there's no delegation limit.

Or you need to consider modifying your formula to only use delegateable functions.

Or else you will get wrong result, for example only the first one in your issue.

3309.PNG

 

Here's a doc about delegation problem for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

 

My list is much more than 2000 items. I have tried to do it thru collection, but now it returns only 4 records instead of 1, so still not correct

My formula

 

Filter(Collection1,User().Email='Личный кабинет'.Email)

 
 
 

 

Please clarify, are you getting 1 instead of 4 records, if so then delegation issues raised by my colleagues could be the issue.

 

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (3,183)