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

Search in a peoplefield

Hey guys,

 

I'm having the problem of searching and filtering the person field.

 

I have a list of items that are assigned to a person. Now it should be possible to search for these persons.

 

This does not lead to success:

 

Search (SortByColumns (SharePointList,"Created", Ascending), SearchBox. text,"Name of the column with the assigned person")

It is a complex field, so I would have to go for a value. DisplayName, email, whatever.

 

But how do I get this included in the formula?

 

Search (SortByColumns (SharePointList,"Created", Ascending), SearchBox. text,"Name of the column with the assigned person".DisplayName)

This is not possible.

Additional columns are searched, this always works as long as it is not a complex column.

 

I've already built larger search queries elsewhere in the app, at first only with "filter". However, the "Search" function is much more effective and faster. That's why I wanted to use this function again. But with the people field.

If only the "filter" function is used, it must be possible to make suggestions after the third letter. Is this possible?

 

Best regards from Germany

 

Edit1: What I have to add, this is a gallery in which I want to search/filter.

Edit2: I used the Code function to display the functions.

8 REPLIES 8
Raf
Level: Powered On

Re: Search in a peoplefield

I had the same issue earlier and I couldn’t find any available work around. So, this is what I did, I created a new SP column which is calculated based on the column I wanted to show. And I made sure it is hidden in my SP view. Any calculated column is not considered as complex base on my observation. This works for me let me know if it works for you as well. ITEMS = Filter('Tracker', StartsWith(ROCRef, Gallery1.Selected.Result))
Nando
Level: Powered On

Re: Search in a peoplefield

That would be possible, but it would be better if you could search for the column itself. 

Community Support Team
Community Support Team

Re: Search in a peoplefield

Hi @Nando,

 

It seems that Search function won't work with People and Group field. I have got the same result.

 

This formula won't work while searching in searchbox ("People" is a People and Group column name):

Search(SortByColumns('List Test',"Created", Ascending), TextSearchBox1.Text,"People") 

But this formula works while searching:

Search(SortByColumns('List Test',"Created", Ascending), TextSearchBox1.Text,"Title") 

According to https://docs.microsoft.com/en-us/powerapps/functions/function-filter-lookup:

Unlike Filter and LookUp, the Search function uses a single string to match instead of a formula.

 

It seems that Search handles differently from Filter. I will discuss this with others who are more familiar with this and update here is there is any result later.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Nando
Level: Powered On

Re: Search in a peoplefield

Hi Mona,

 

is there another workaround available?

 

I have created a shopping and inventory system (backend App for admins). The items are assigned to people, not being able to search for them would be a very bad user impact. 

 

In my SharePoint environment, it is not possible to apply the calculated column to the person column. Unfortunately, @Raf proposal is not a solution either.
A SharePoint workflow that automatically fills a tmp_column with required information is out of the question for my customer.

 

I would be happy to accept other suggestions or even solutions Smiley Happy

Raf
Level: Powered On

Re: Search in a peoplefield

Raf
Level: Powered On

Re: Search in a peoplefield

I think this is what you need: https://today.collab365.community/story/sharepoint-me-filter-in-powerapps/ SharePoint [Me] Filter in PowerApps idubbs.com
Nando
Level: Powered On

Re: Search in a peoplefield

Hi @Raf

 

I'm Using two O365 groups, to identify two user groups.


The first is just the simple user.
These users only see what has been assigned to them.

 

The second group are administrators, sales assistants and similar.

In the article overview there is a button, which is only displayed to the users of the second group.
With this button the second group navigates to a search screen.

On this screen, this group of people should be able to search for specific persons.

Raf
Level: Powered On

Re: Search in a peoplefield

Im talking about work around as I think I've done similar thing before, so what I did is I created calculated for the assigned to column and I have the default author. and applied below Filter(MyTracker', Author.Email=User().Email) -- this only shows the items of current encoder using Email OR if full name Filter('MyTracker', Author.FullName=User().FullName) -- this only shows the items of current encoder using full name Filter('MyTracker', refAssignedTo.FullName=User().FullName) -- this shows calculated person to represent the assignment of ticket using full name. Im not sure if there is better work around, but I think you can play with it.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 111 members 4,904 guests
Please welcome our newest community members: