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 Filtered Data
Power Apps
Answered

Searching Filtered Data

(0) ShareShare
ReportReport
Posted on by 15

Hello PA Community!

 

I'm presenting the data to the user filtered by the comments made by the user. Then, I want the user to be able to search by name. Here are the separate searches that work; I just can't get them to work together.

 

//This search queries the comment list and outputs the comments made by the user in descending order

Sort(

    Filter(

        CSTComments,

        'Created By'.Email = User().Email

    ),

    Created,

    Descending

)

 

//This search allows the data in CSTComments to search the data by first name. Note: I can't use the StartsWith function because the data I'm working with has the name set to (Student) at the beginning of each student's name.

Search(

    AddColumns(

        CSTComments,

        "displayname",

        'StudentInfo'.DisplayName

    ),

    myCommentsSearch.Text,

    "displayname",

    "Title"

)

 

Any help will be much appreciated.

Kind regards, 

 

Brian

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,656 Most Valuable Professional on at

    Hi @BriantheTeacher ,

    You have not stated your data source, but assuming SharePoint, this will preserve some element of Delegation capability

    With(
     {
     wData:
     Sort(
     Filter(
     CSTComments,
     'Created By'.Email = User().Email
     ),
     Created,
     Descending
     )
     }, 
     Search(
     AddColumns(
     wData,
     "displayname",
     'StudentInfo'.DisplayName
     ),
     myCommentsSearch.Text,
     "displayname",
     "Title"
     )
    )

     

    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

  • BriantheTeacher Profile Picture
    15 on at

    Hi Warren,

     

    This is exactly what I needed. Thank you for your quick and excellent response.


    Kind regards, 

    Brian

  • BriantheTeacher Profile Picture
    15 on at

    Question: I noticed after the filter/search function works correctly, the selection functionality is no longer working. Is there a way that when the user selects a record, that the comment for that record can be displayed? Here's screen shot that shows what they user would click and where the comment would show up.user clicks the student on the left and the corresponding html comment shows up in the box.user clicks the student on the left and the corresponding html comment shows up in the box.

     

    Thanks,

     

    Brian

  • WarrenBelz Profile Picture
    155,656 Most Valuable Professional on at

    Hi @BriantheTeacher ,

    What is the code you are using to for the pop-up and what is the error you are receiving ?

  • BriantheTeacher Profile Picture
    15 on at

    It wasn't finding the item that was selected. I kept working on it and found this solution that continued to provide access to the ThisItem in my SharePoint data source. I'm wondering if there is a way to access the AddColumns data?

     

    Here's the search I used:
    Filter(
    CSTComments,
    And(
    Or('Created By'.Email = User().Email),
    myCommentsSearch.Text in StudentInfo.DisplayName ||
    myCommentsSearch.Text in Comments ||
    myCommentsSearch.Text in StudentID
    )
    )

  • WarrenBelz Profile Picture
    155,656 Most Valuable Professional on at

    Hi @BriantheTeacher ,

    I am a little confused on exactly what you want here - if you need EITHER the user's records OR the Search of the other three fields, this will do it

    Filter(
     CSTComments,
     'Created By'.Email = User().Email ||
     myCommentsSearch.Text in StudentInfo.DisplayName ||
     myCommentsSearch.Text in Comments ||
     myCommentsSearch.Text in StudentID
    )

    You did not state your data source, but I assume it is SharePoint and if so, it is not Delegable. If you want the person to filter their own records, then what I posted originally will work with some Delegation as the top filter can be used to "pre-filter" and as long as the returned records are under your limit. What is it you want to with the AddColumns ?

  • BriantheTeacher Profile Picture
    15 on at

    My datasource is SharePoint. I want the user to sort through filtered results where each comment is one they made. Then, I want them to be able to select a comment and it show up in the box to the right which is a form with a text input that should get the comments from the selected record. 

  • WarrenBelz Profile Picture
    155,656 Most Valuable Professional on at

    @BriantheTeacher .

    OK - I need to know if we are still talking about the filter or if the issue is now the pop-up - I now suspect the latter. Is the pop-up a Text input and if so, what is the Default  and what if anything is the OnSelect of the Gallery ?

  • BriantheTeacher Profile Picture
    15 on at

    Thanks for the reply...I don't want to leave you hanging. I'll get home from work later today and can respond. Have a good day.

     

    Brian

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard