cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Creating a filter so that the current user can only see data that's applicable to them

Creating a PowerApp to help track training completed for employees. The data is being pulled from a sharepoint list, and I created the PowerApp from the SP list.  I keep getting an issue when I try to filter the data shown so that the Employee can only see data that is noted in the sharepoint list as them in a column called Participant; the Properties of the BrowseGallery says No Data and in the advanced tab in data items I get a message that says: formula cannot be evaluated remotely due to service limitations...local evaluation may produce suboptimal or partial results

Currently I have the OnStart:

Set(CurrentUser, User().FullName)

and then in BrowseGallery Data Items:

Filter('Training Management', 'Participant' = User().FullName)

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi,

 

What is the "Participant" field type, a Person or Group type?

Besides, please change the formula of your function as below:

OnStart:

Set(CurrentUser, User())

Then in BrowseGallery Data Items: 

Filter('Training Management', 'Participant' = CurrentUser.FullName)

If the Participant is a Person or Group type, then please switch the formula as below:

Filter('Training Management', 'Participant'.Email = CurrentUser.Email)

The message indicates there are delegation issues with your formula, for more information about delegation, see:

Understand delegation

Delegable data sources 

 

If the Participant is a Person Or Group Type field, to workaround the delegation, please switch the formula as below:

Filter(AddColumns('Training Management', "ParticipantEmail", 'Participant'.Email),
       ParticipantEmail=CurrentUser.Email)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

Hi,

 

What is the "Participant" field type, a Person or Group type?

Besides, please change the formula of your function as below:

OnStart:

Set(CurrentUser, User())

Then in BrowseGallery Data Items: 

Filter('Training Management', 'Participant' = CurrentUser.FullName)

If the Participant is a Person or Group type, then please switch the formula as below:

Filter('Training Management', 'Participant'.Email = CurrentUser.Email)

The message indicates there are delegation issues with your formula, for more information about delegation, see:

Understand delegation

Delegable data sources 

 

If the Participant is a Person Or Group Type field, to workaround the delegation, please switch the formula as below:

Filter(AddColumns('Training Management', "ParticipantEmail", 'Participant'.Email),
       ParticipantEmail=CurrentUser.Email)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi, 

The coding you've supplied me has helped in that I'm now receiving results again!  The Participant column is a Person or Group type. For some reason it appears that its retrieving data from a column in the SP list called Instructor which the values are all email addresses.  The Participant value has to be manually entered and it grabs the information from my company's Active Directory which I'm unsure of if that is causing this new error? Also when I go into the DetailScreen I'm getting an error that says: Invalid Formula. Expected a value compatible with 'Data Source'

I'm using the code in the BrowseGallery Data Items:

Filter(AddColumns('Training Management', "ParticipantEmail", 'Participant'.Email), ParticipantEmail=CurrentUser.Email)

Thanks for your help so far!

 

Also if theres a way to also make it sort via a choices column called 'Course Progress' where the choices are: Pending, In Progress, Completed, Abandoned. I'd greatly appreciate it. This is my first real dip into PowerApps

 

 

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,899)