web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Searching on a people/...
Power Apps
Answered

Searching on a people/person field

(0) ShareShare
ReportReport
Posted on by 59

We have an app for requests management. The requests go through 4 phases and each phase has an "assigned to" person/people field. Business user wants to be able to include these 4 person/people field in our Search. 

 

Coded the search on the gallery's item property. However, I am getting an error on the people/person field saying "The function 'Search' has some invalid arguments. Wrong column type. Expect text type". Obviously the person/field is not seen as text.

 

Anybody have a workaround for this? 

 

Thanks.

 

btw. Business users also want to include Date fields on the search and getting the same error in including them on the 'Search' code.

Categories:
I have the same question (0)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    What is the formula you are using in the Items property of Gallery to do the search?

  • Kala Profile Picture
    Microsoft Employee on at

    Hi FredG,

     

    Search Function supports only string searches. Have you used Filter / Lookup functions? They take other fields that are not string.

     

    You can findthe examples and usage here: https://docs.microsoft.com/en-us/powerapps/functions/function-filter-lookup

     

    Let me know if this helps.

     

    Thanks

    Kala Anantharaman

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Maybe you've figured out a workaround in the meantime, if not, here's a way to do it.

    Create an additional column in your SharePoint list of type single line of text.

    If your person column is "AssignedTo", name the new column "AssignedToString" or the like.

    Create a Flow triggered by "When an item is created"

    Action "Update Item"

    Populate AssignedToString field with AssignedTo.DisplayName

    Now you have a text field containing the AssignedTo person's name and can thus include it in the Search function

    Search(DataSource,TextSearchBox1.Text,"AssignedToString")

    I've done this for multiple person fields in a list, e.g. AssignedToString, ProjectManagerString, ApproverString with the result that a user can search for a fraction of his name and will see all records where he figures in any of these roles.

    I've as well used it for the ID of a record. so that in the same search box you can enter the ID and find any matches. Not very elegant because searching for 12 will not only return 12 but any ID containing the string "12" (123, 312, 3125, whatever).

    I think date fields can be dealt with in the same way, but an exact date will have to be entered as search term, as otherwise the results will be quite ambiguous (03/20 for example could return 03/20/2018 but as well 05/03/2018.

    Please let me know if this helps.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    SortByColumns(
     Search(
     Filter(
     'Itemlist',
     Prod.Value = If(tglTestProd.Value, "Production", "Test")
     ),
     TextSearchBox1.Text,
     "Title",
     "idSearchString",
     "reqSearchString",
     "coordSearchString",
     "emplSearchString",
     "statusSearchString"
     ),
     "ID",
     If(
     SortDescending1,
     Descending,
     Ascending
     )
    )

    Where the ...SearchString columns are the ones with the string values populated by the workflow.

  • MaciejKucharski Profile Picture
    13 on at

    I've encountered a similar problem and found a workaround with AddColumns() function here:

     

    https://www.spguides.com/powerapps-search-user/#PowerApps_Search_Person_Field:~:text=Group%20in%20PowerApps-,PowerApps%20Search%20Person%20Field,-Do%20you%20want

     

    Hope it helps someone who had been struggling with this too and kudos to SPGuides for posting it. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 333 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 86 Super User 2026 Season 1

Last 30 days Overall leaderboard