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 :
The basic formula in Power Apps is this:
SortByColumns(Filter([@'Notes de frais']; StartsWith(Title; TextSearchBox1.Text)); "Title"; If(SortDescending1; Descending; Ascending))
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))
Thank you in advance for your help !
It's work thanks !
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 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
My Sharepoint list if you want :0 :
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.
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))
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:
Best Regards,
Charlie Choi
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
WarrenBelz
146,522
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,890
Most Valuable Professional