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 / Filtering gallery base...
Power Apps
Answered

Filtering gallery based on text compared to person column

(0) ShareShare
ReportReport
Posted on by 716 Moderator

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:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    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

  • DCHammer Profile Picture
    716 Moderator on at

    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
    154,930 Most Valuable Professional on at

    @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
    716 Moderator on at

    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.

  • Verified answer
    DCHammer Profile Picture
    716 Moderator on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard