Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Filter the content of a column, search bar

(1) ShareShare
ReportReport
Posted on by 691

Hello,
I have a Sharepoint list called "Note de Frais" and on my Power Apps application I would like to filter from the "Nom Prenom" column (which is a person field). I want to do this because I would like to create a search bar which will filter the "Nom Prenom" of the users.

 

My SharePoint list :

s44_1-1641214922274.png

 

 

 

The basic formula in Power Apps is this: 

 

 

SortByColumns(Filter([@'Notes de frais']; StartsWith(Title; TextSearchBox1.Text)); "Title"; If(SortDescending1; Descending; Ascending))

 

 

 

s44_0-1641914929523.png

 

 

 

I tried to modify it like this but it shows me errors:

 

 

 

 

 

SortByColumns(Filter([@'Notes de frais']; StartsWith(Nom Prenom; TextSearchBox1.Text)); "Nom Prenom"; If(SortDescending1; Descending; Ascending))

 

 

 

 

 

 

s44_0-1641894868108.png

 

Thank you in advance for your help ! 

  • s44 Profile Picture
    691 on at
    Re: Filter the content of a column, search bar

    It's work thanks !

  • Verified answer
    v-yujincui-msft Profile Picture
    on at
    Re: Filter the content of a column, search bar

    Hi @s44 ,

     

    Maybe you should use TextSearchBox1.Text.

     

    Best Regards,

    Charlie Choi

  • s44 Profile Picture
    691 on at
    Re: Filter the content of a column, search bar

    @v-yujincui-msft   I have this error with this formula 😞

    s44_0-1642065130031.png

     

  • v-yujincui-msft Profile Picture
    on at
    Re: Filter the content of a column, search bar

    Hi @s44 ,

     

    The problem seems to be in your reference to the data source, you could try adding single quotes to the data source in the formula.

     

    SortByColumns(
           Filter(
                AddColumns(
                   'Notes de frais',//You should reference your data source with a single quotes
                          "nomprenomdisplayname",
                          'Nom Prenom'.DisplayName
                ),
                StartsWith(nomprenomdisplayname,TextSearchBox3.Text)
            ),
            "nomprenomdisplayname",
            If(SortDescending1,Descending,Ascending)
    )

     

    Best Regards,

    Charlie Choi

  • s44 Profile Picture
    691 on at
    Re: Filter the content of a column, search bar

    @v-yujincui-msft  Yes, I want to filter the records according to the "Person" type column.
    No it is not necessary to use SortByColumns ()

     

    Your formula doesn't work or me :c

    s44_0-1641985980129.png

    s44_1-1641986148072.png

     

     

    My Sharepoint list if you want :0 : s44_1-1641214922274.png

  • v-yujincui-msft Profile Picture
    on at
    Re: Filter the content of a column, search bar

    Hi @s44 ,

     

    Do you want to filter records by Person column?

    It seems that you cannot use SortByColumns() in the "Person or Group" column of a SharePoint list.

    In addition, Is it necessary for you to use SortByColumns()?

     

    I have made a test for your reference.

     

    1.Here is my SharePoint list.

    vyujincuimsft_0-1641964434729.png

    2.Select the Gallery Control and apply the following formula on its property as:

    SortByColumns(Filter(AddColumns(recruitrequest,"applicantdisplayname",applicant.DisplayName),StartsWith(applicantdisplayname,TextSearchBox1.Text)),"applicantdisplayname",If(SortDescending1, Descending, Ascending))

    vyujincuimsft_1-1641964434735.png

    3.In addition, you can try to use Sort() function.

    Sort(Filter(recruitrequest,StartsWith(applicant.DisplayName,TextSearchBox1.Text)),"applicant",If(SortDescending1,Descending,Ascending))

    Result Screenshots:

    vyujincuimsft_2-1641964434737.png

     

    Best Regards,

    Charlie Choi

  • s44 Profile Picture
    691 on at
    Re: Filter the content of a column, search bar

    It's does'nt work :c @AJ_Z 

    s44_0-1641910789824.png

     

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at
    Re: Filter the content of a column, search bar

    instead of Nom Prenom try doing 'Nom Prenom'

     

    e.g.

     

    SortByColumns(Filter([@'Notes de frais']; StartsWith('Nom Prenom'; TextSearchBox1.Text)); "Nom Prenom"; If(SortDescending1; Descending; Ascending))

     

    let me know what happens when you make that change

     

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,522 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,890 Most Valuable Professional

Leaderboard