cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
s44
Post Patron
Post Patron

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

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 !

 

 

 

 

My sharepoint list : s44_1-1641214922274.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

If( varFilter = false;
WHAT YOU HAVE; //PUT THERE WHAT YOU HAVE WRITE NOW
Filter('Notes de frais';'Créé par'.Email = User().Email) // PUT HERE WHAT YOU WANT TO FILTER WHEN YOU PRESS THE BUTTON
)

View solution in original post

15 REPLIES 15
Nogueira1306
Super User
Super User

Try this:

 

Filter('Notes de frais';'Créé par'.Email=BrowseGallery1.Selected.'Créé par'.Email)

 

That will filter your 2º gallery by Created By. So, imagine, tha tyou pick something created by you on browseGallery1. I twill only show items create by you on the seconde one.

 

To fitler a gallery by User().Email try this:

Filter('Notes de frais';'Créé par'.Email = User().Email)

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

@Nogueira1306 It's doesn't work 😞

s44_0-1642070244536.png

 

Instead of Created By field use the field that you creaetd "Nom Prenom"

 

That means that the filter failed, the query failed

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

@Nogueira1306 How so ? Can you write me the line I should put please? I don't think I understood what you meant :0

Filter('Notes de frais';'Nom Prom'.Email=BrowseGallery1.Selected.'Nom Prom'.Email)

@Nogueira1306  Using this formula, when I click on the button nothing happens now 😞

My msitake. Because I only underssod now that you want to filter when you click a button...

So, on app Start, write this:
Set(varFilter; false)

 

On Button, OnSelect:

Set(varFilter; true)

On gallery write this:

 

If( varFilter = false;
'Notes de frais'; //IT SHOWS EVERYTHING
Filter('Notes de frais';'Créé par'.Email = User().Email)
)

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

 

Thank you ! But can you show me where are OnGallery and On app Start please :0 ? I'm new to Power

Apps >< @Nogueira1306 

s44_0-1642076484161.png

 

Gallery:

Nogueira1306_0-1642077083830.png

 

 

App OnStart:

Nogueira1306_1-1642077121996.png

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (4,411)