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

Filtering current user in a multi-person column

Hi ,

 

I have a SP List with a person type column which may include multiple owners/persons in a single row. 

In my app gallery, I need to display only those rows in which the current user is one of the owners.

I am aware that I will hit the delgation warning if I try to check against a person field in SP List. 

Can someone suggest a workaround please?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filtering current user in a multi-person column

Hi @AJ13 ,

 

What formula expression do you use now?

If you just get the warning it is just warning, not the error.

More details about delegation:

understand delegation in cavas-app

 

I test on my side also has the delegation(as App test1):

Filter('20190226filtermultipleperson',User().FullName in ShowColumns(PersonM,"DisplayName"))   (‘20190226filtermultipleperson’ is my sp list name)

If you do not want the delegation warning, you could try to use the collection to collect your data firstly,and then filter.(As App test2)

 

App test1:

20190226Filtering current user in a multi-person column1.jpg

App test2:

Add one button control and then Button5.OnSelect: ClearCollect(test,'20190226filtermultipleperson')

And then Gallery3.Items: Filter(test,User().FullName in PersonM.DisplayName)

20190226Filtering current user in a multi-person column2.jpg

 

Hope this can be helpful.

Best Regards.

Yumia

View solution in original post

9 REPLIES 9
Community Support Team
Community Support Team

Re: Filtering current user in a multi-person column

Hi @AJ13 ,

 

What formula expression do you use now?

If you just get the warning it is just warning, not the error.

More details about delegation:

understand delegation in cavas-app

 

I test on my side also has the delegation(as App test1):

Filter('20190226filtermultipleperson',User().FullName in ShowColumns(PersonM,"DisplayName"))   (‘20190226filtermultipleperson’ is my sp list name)

If you do not want the delegation warning, you could try to use the collection to collect your data firstly,and then filter.(As App test2)

 

App test1:

20190226Filtering current user in a multi-person column1.jpg

App test2:

Add one button control and then Button5.OnSelect: ClearCollect(test,'20190226filtermultipleperson')

And then Gallery3.Items: Filter(test,User().FullName in PersonM.DisplayName)

20190226Filtering current user in a multi-person column2.jpg

 

Hope this can be helpful.

Best Regards.

Yumia

View solution in original post

AJ13
Level: Powered On

Re: Filtering current user in a multi-person column

@v-yuxima-msft 

Thank you Yumia.

App2 works fine when I collect the records first. The gallery lists my records

Filter(AllRecords,Me in SPOCs.Email)

Allrecords is set to ClearCollect(AllRecords,'Logical Access')

 

But App1 throws a deleagtion warning and no records are fetched.

Filter('Exception Tracker',Me in ShowColumns(SPOCs,"Email")

SPOCs is the mutiperson column in SP List and me is set to Office365Users.MyProfile().Mail

Community Support Team
Community Support Team

Re: Filtering current user in a multi-person column

Hi @AJ13 ,

 

Could you please try to use User().Email to instead of Me in your  formula expression to test?

Filter('Exception Tracker',Me in ShowColumns(SPOCs,"Email")

 

Best Regards.

Yumia

Community Support Team
Community Support Team

Re: Filtering current user in a multi-person column

Hi @AJ13 ,

 

Filter('Exception Tracker',Me in ShowColumns(SPOCs,"Email")) (please do not miss ")")

 

Best Regards.

Yumia

AJ13
Level: Powered On

Re: Filtering current user in a multi-person column

Hi @v-yuxima-msft 

 

User().email will not work in my case because it fetched me email in a different format.

User().email gives me <mailnickname or employee id>@domain.com

 

In my SP persons column the email feteches me <firstname>.<lastname>@domain.com

 

 

AJ13
Level: Powered On

Re: Filtering current user in a multi-person column

Hey @v-yuxima-msft , it worked !!!

 

Thank you very much Smiley Happy

It wasn't working in the app but works when published.

Community Support Team
Community Support Team

Re: Filtering current user in a multi-person column

Hi @AJ13 ,

 

You are welcome.

 

Best Regards.

Yumia

Highlighted
AJ13
Level: Powered On

Re: Filtering current user in a multi-person column

@v-yuxima-msft  The line is now giving me problems. My total records have exceeded 2000 in SP list and new records are no longer fetched due to the delegation issue. Please help.

Community Support Team
Community Support Team

Re: Filtering current user in a multi-person column

Hi @AJ13 ,

 

Could you please change the value to 2000(File->App settings->Advanced settings)?

20190326splimit.PNG

And could you please reference:

https://powerusers.microsoft.com/t5/General-Discussion/500-rows-limit/td-p/93826

 

Hope this could be helpful.

 

Best Regards.

Yumia

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,271)