Hello, I have a Sharepoint "Notes de frais" list and I would like to create a Power Apps application allowing managers in my company to create expense reports for company employees.
I would like to create a Power Apps application where on this page
there is a button (located somewhere on the red banner for example) which allows, when we click on it, to display all the expense reports that the connected manager has created.
I tried this but it doesn't work:
Filter('Notes de frais';User().Email=BrowseGallery1.Selected.'Créé par'.Email)
when I connect to the account of a person who has not created any expense report, when I click on the button I still see all the expense reports. While normally it's supposed to show none since I logged in with an account that didn't create any expense reports.
Could you help me please? Thanks in advance !
(I cannot edit the code in "item" of "BrowserGallery" because I already have some useful code in it.)
My sharepoint list :
Hi @s44 ,
This formula should work for your Gallery:
If(userstatus= true ;Filter('Notes de frais';User().Email='Créé par'.Email);
SortByColumns(Filter(AddColumns('Notes de frais';"nomprenomdisplayname";'Nom Prenom'.DisplayName);
StartsWith(nomprenomdisplayname;TextSearchBox1.Text));"nomprenomdisplayname";If(SortDescending1,Descending,Ascending)))
Best Regards,
Charlie Choi
Hi @s44 ,
Do you want to filter the records belonging to the current user by clicking a button?’
I have made a test for you.
Here is my SharePoint list.
1.Select the Screen and set its OnVisible property as below:
Set(userstatus,false)
2.Add a Button Control and apply the following formula on its OnSelect property as:
Set(userstatus,!userstatus)
3.Select the Button Control and apply the following formula on its Text property as:
If(userstatus=true,true,false)
4.Select the Gallery and apply the following formula on its items property as:
If(userstatus= true ,Filter(recruitrequest,User().Email=applicant.Email),
SortByColumns(Filter(AddColumns(recruitrequest,"applicantdisplayname",applicant.DisplayName),
StartsWith(applicantdisplayname,TextSearchBox1.Text)),"applicantdisplayname",If(SortDescending1,Descending,Ascending)))
Result Screenshots:
Best Regards,
Charlie Choi
You are putting a resulting table function (Filter) into a behavioral action (OnSelect).
Filter is going to return a table based on your criteria. But it will go nowhere! This is because OnSelect is a behavioral action. It does things, it does not return things!
What is the Items property of your Gallery?
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional