cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
s44
Helper V
Helper V

Filter the content of a column, search bar

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 ! 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @s44 ,

 

Maybe you should use TextSearchBox1.Text.

 

Best Regards,

Charlie Choi

View solution in original post

8 REPLIES 8
AJ_Z
Super User
Super User

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

 

If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !

It's does'nt work :c @AJ_Z 

s44_0-1641910789824.png

 

v-yujincui-msft
Community Support
Community Support

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

@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
Community Support
Community Support

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

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

s44_0-1642065130031.png

 

v-yujincui-msft
Community Support
Community Support

Hi @s44 ,

 

Maybe you should use TextSearchBox1.Text.

 

Best Regards,

Charlie Choi

It's work thanks !

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,587)