Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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

 

  • Verified answer
    v-yujincui-msft Profile Picture
    on at
    Re: Create a button to display all the expense reports that the connected person has created

    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 

  • v-yujincui-msft Profile Picture
    on at
    Re: Create a button to display all the expense reports that the connected person has created

    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

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Create a button to display all the expense reports that the connected person has created

    @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?

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

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard