cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marial16
Post Partisan
Post Partisan

Search person or group field in powerapps

Hallo,

I was wondering if there is another way to use a search input field for person or group fields instead of creating an additional column in the SharePoint list with the display name as a text field

 

i use a gallery and filter my list. and i have already used search function but regarding single lone of text fields

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @marial16 ,

Do you want to filter based on display name of person or group field?
Two solutions:
1)use search function

Yes, if you use search function, you need to add a column with display name as a text field.

The reason is that search function only works for text type field. Other data type are not supported.

So the formula should be like this:

Search(AddColumns(table,"displayname",personfield.DisplayName),
       Textinput.Text,
       "displayname",
       "field1","field2",...)

2)use filter function

Filter function could work for multiple data type.

If you use this function, you no longer need to add another column.

Formula should be like this:

Filter(table,
Textinput.Text in personfield.DisplayName,
Textinput.Text in field1,
Textinput.Text in field2,
....)

 

 

 

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

5 REPLIES 5
v-yutliu-msft
Community Support
Community Support

Hi @marial16 ,

Do you want to filter based on display name of person or group field?
Two solutions:
1)use search function

Yes, if you use search function, you need to add a column with display name as a text field.

The reason is that search function only works for text type field. Other data type are not supported.

So the formula should be like this:

Search(AddColumns(table,"displayname",personfield.DisplayName),
       Textinput.Text,
       "displayname",
       "field1","field2",...)

2)use filter function

Filter function could work for multiple data type.

If you use this function, you no longer need to add another column.

Formula should be like this:

Filter(table,
Textinput.Text in personfield.DisplayName,
Textinput.Text in field1,
Textinput.Text in field2,
....)

 

 

 

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.

when you say table you mean the name of the List?

Hi @marial16 ,

Yes, that's right.

You could refer the syntax for these two functions:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

 

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.

I tried your suggestion for the filter function, but now my gallery will only filter based on the first character entered in the text box. When 2 characters are entered it does not return any results in the list even though they should exist.

For the Filter function, you need to use the or operator instead of commas:

Filter(table,
Textinput.Text in personfield.DisplayName ||
Textinput.Text in field1 ||
Textinput.Text in field2 ||
....)

 

Helpful resources

Announcements
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.

Users online (2,374)