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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering gallery base...
Power Apps
Unanswered

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
    153,026 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
    153,026 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard