Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Filtering gallery based on text compared to person column

(0) ShareShare
ReportReport
Posted on by 714 Super User 2025 Season 1

Ok, here is the current code:

 

SortByColumns(
 Filter(
 [@'BusMarket - IBC PreSurvey'], 
 TextSearchBox1.Text in 'Sales Team Information'.DisplayName
 || TextSearchBox1.Text in Customer
 || TextSearchBox1.Text in 'Customer Contacts'
 || TextSearchBox1.Text in 'Customer Phones'
 || TextSearchBox1.Text in 'Customer Email'
 || TextSearchBox1.Text in Customer
 || TextSearchBox1.Text in 'Service Address'
 || TextSearchBox1.Text in 'Primary Phone Number'
 || TextSearchBox1.Text in 'Lotus Notes/Presurvey Number'
 ), 
 "Created", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)
)

 

I recognize this results in a delegation problem. We'll address that with scheduled data archival to stay under the limit.

My problem is the text entered in TextSearchBox1 does not return records where the text string exists within the names contained in the 'Sales Team Information' column which is a Person/Group column in SP.

 

I'm sure the problem is that since 'Sales Team Information' contains a table and not even just a single record, .DisplayName is meaningless.

Categories:
  • Verified answer
    DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Filtering gallery based on text compared to person column

    I made it work. Here was my solution:

     

    I used Concat to convert the contents of the Person column into one long text string. In fact, it's exactly the same Concat function that I used to display the names in that field within the form for users to visually see.

     

    Then you just compare the text string to the text. Easy peasy lemon squeezy. Only took four days. 😄

     

    SortByColumns(
     Filter(
     [@'BusMarket - IBC PreSurvey'],
     TextSearchBox1.Text in Concat(
     'Sales Team Information',
     DisplayName & ", "
     ) || TextSearchBox1.Text in Customer || TextSearchBox1.Text in 'Customer Contacts' || TextSearchBox1.Text in 'Customer Phones' || TextSearchBox1.Text in 'Customer Email' || TextSearchBox1.Text in Customer || TextSearchBox1.Text in 'Service Address' || TextSearchBox1.Text in 'Primary Phone Number' || TextSearchBox1.Text in 'Lotus Notes/Presurvey Number'
     ),
     "Created",
     If(
     SortDescending1,
     SortOrder.Descending,
     SortOrder.Ascending
     )
    )

    Forgive the nasty formatting. That's PowerApps making a mess.

  • DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Filtering gallery based on text compared to person column

    Thank you Warren. But that didn't work either.

    Console shows an error in the Search function. It's also telling me all of those fields don't exist.

  • WarrenBelz Profile Picture
    146,587 Most Valuable Professional on at
    Re: Filtering gallery based on text compared to person column

    @DCHammer ,

    You can also try this

    SortByColumns(
     Search(
     AddColumns(
     [@'BusMarket - IBC PreSurvey'],
     "SalesTeam",
     'Sales Team Information'.DisplayName
     ),
     TextSearchBox1.Text,
     "SalesTeam", 
     "Customer", 
     "Customer Contacts", 
     "Customer Phones", 
     "Customer Email", 
     "Customer", 
     "Service Address", 
     "Primary Phone Number", 
     "Lotus Notes/Presurvey Number"
     ), 
     "Created", 
     If(
     SortDescending1, 
     SortOrder.Descending, 
     SortOrder.Ascending
     )
    )
  • DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Filtering gallery based on text compared to person column

    It didn't work I'm afraid. It also didn't break anything. It does exactly what the original code did which is filter successfully based on contents of all fields except the sales team members in the Sales Team Information field.

     

    I'm done for Friday. 😊

    I'll try this again Monday.

    Oh, and that's more than just a reference. We still have a significant number of business processes that are actively using Notes today.

  • WarrenBelz Profile Picture
    146,587 Most Valuable Professional on at
    Re: Filtering gallery based on text compared to person column

    Hi @DCHammer ,

    Try this instead

    SortByColumns(
     Filter(
     AddColumns(
     [@'BusMarket - IBC PreSurvey'],
     "SalesTeam",
     'Sales Team Information'.DisplayName
     ),
     TextSearchBox1.Text in SalesTeam || 
     TextSearchBox1.Text in Customer || 
     TextSearchBox1.Text in 'Customer Contacts' || 
     TextSearchBox1.Text in 'Customer Phones' || 
     TextSearchBox1.Text in 'Customer Email' || 
     TextSearchBox1.Text in Customer || 
     TextSearchBox1.Text in 'Service Address' || 
     TextSearchBox1.Text in 'Primary Phone Number' || 
     TextSearchBox1.Text in 'Lotus Notes/Presurvey Number'
     ), 
     "Created", 
     If(
     SortDescending1, 
     SortOrder.Descending, 
     SortOrder.Ascending
     )
    )

    BTW nostalgic reference to Lotus Notes made my day (my weapon of choice a long time ago)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,587 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard