cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LewisNage
New Member

How to Filter data automatically that appears on a DataTable to only relate to a column that contains a user's Email / UserPrinicipleName (UPN)

Hi, 

 

I've been trying to implement something in a PowerApp for days now, but I can't seem to resolve it!

 

We have modified the Leave Requests / Holiday Requests PowerApp, to our own.

It works great!

 

The App creates, modifies several SharePoint Lists.
A list for total Holiday Allowance (Remaining in Hours)

A list for total Holiday Requests (current status, how many, how many days etc.)

A list of all Bank Holidays.

 

When the user for example created a holiday request, they enter the details, they create an entry in the SharePoint list and other things happen.

 

We want to have a screen that displays 3 Datatables with the above listed data, but rather than display all the SharePoint Listed Entries, we want the DataTables to filter and only show data that related to the User, by their UserPrincipleName or Email.

 

The Holiday Allowance list, has two Columns. One is the Username (UserPrincipleName / Email), the other is the total remaining holiday allowance time (in Hours).


Is there a way to automatically filter this data, so when the user goes to a certain screen, it displays this table and only lists the Holiday Allowance for that particular user (Filter to only display the logged in user of the apps matching UPN or Email)?

 

I have tried lots of different things when editing the syntax for the the Holiday Allowance DataTable such as:

Filter('Holiday Allowance',Title_Column2.Value=Office365Users.MyProfile().UserPrincipalName)

Filter('Holiday Allowance',Title_Column2 User().UserPrinicipleName)

Filter('Holiday Allowance', 'Title_Column2' = CurrentUser.UserPrinicipleName)

 

But nothing works! The last one is the best I've got so far, that does not display an error message, but it displays no data! 😕

 

LewisNage_0-1618417519253.png

 

Can my request be done or is it not possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Mari
Microsoft
Microsoft

Hi! Try with any of these formulas:

Filter(FlowList, Name12 = User().Email)


Filter(FlowList, Name12 = Office365Users.MyProfileV2().userPrincipalName)

 

Mari_0-1618589164153.png

 

View solution in original post

2 REPLIES 2
Mari
Microsoft
Microsoft

Hi! Try with any of these formulas:

Filter(FlowList, Name12 = User().Email)


Filter(FlowList, Name12 = Office365Users.MyProfileV2().userPrincipalName)

 

Mari_0-1618589164153.png

 

View solution in original post

I've tried this and it worked!

Amazing thank you Mari!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (68,613)