web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create a button to dis...
Power Apps
Unanswered

Create a button to display all the expense reports that the connected person has created

(0) ShareShare
ReportReport
Posted on by 691

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

s44_0-1641987879360.png

 

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)

 

 

s44_0-1642067087862.png

 

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.

s44_1-1642067187936.png

 

 

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 : s44_1-1641214922274.png

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @s44 

    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?

  • v-yujincui-msft Profile Picture
    on at

    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.

    vyujincuimsft_0-1642411597096.png

    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)))

    vyujincuimsft_1-1642411597102.png

    Result Screenshots:

    vyujincuimsft_2-1642411597132.png

    vyujincuimsft_3-1642411597133.png

     

    Best Regards,

    Charlie Choi

  • Verified answer
    v-yujincui-msft Profile Picture
    on at

    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 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard