cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ddas
Helper II
Helper II

Filter formula not working

Hi All,

 

I have this formula for a gallery that connects to a sharepoint list. It's supposed to show the Employee and if its a manager the employees under that manager. It used to work fine but now it doesn't. Below is the formula.

 

Filter('2019 Goal Settings Form', 'Employee Name'=User().FullName Or 'Created By'.Email=User().Email || 'Manager Email Address:'=User().Email)

 

It seems to work for some people and not others. Any ideas why that is and is there another version of the formula that I can use and will do the same thing. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
ddas
Helper II
Helper II

I changed the formula to this, Filter('2019 Goal Settings Form', 'Employee Name'=User().FullName || 'Created By'.Email=User().Email || 'Manager Name'=User().FullName) and now it is working. 

View solution in original post

5 REPLIES 5
Jeff_Thorpe
Super User
Super User

Try setting a global varible in the App OnStart or the Screens OnVisible with the current user information.

Set(gvCurrentUser, User())

 

Then tweak the formula like this:

Filter('2019 Goal Settings Form', 'Employee Name'=gvCurrentUser.FullName || 'Created By'.Email=gvCurrentUser.Email || 'Manager Email Address:'=gvCurrentUser.Email)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
v-monli-msft
Community Support
Community Support

Hi @ddas ,

 

Is 'Manager Email Address:' a text column that stores the email address of the user's manager? If so, then you shouldn't Filter it with User().Email. User().Email is the email address of current user, not his manager. 

 

You should add the Office 365 Users connector to this app, and then use a below formula instead:

Filter('2019 Goal Settings Form', 'Employee Name'=User().FullName ||'Created By'.Email=User().Email || 'Manager Email Address:'=Office365Users.Manager(User().Eamil).Mail)

Regards,

Mona

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

Hi v-monli-msft,

 

Thanks for the response. That formula will not work because it ends up showing all the users that share the same manager which is not what we want. I'll give you more detail. If a user is not a manager they will only see their form. If a manager opens the app they see their form but also the people they manage only. Hope that makes it clear what we are trying to do.

 

Regards,

 

ddas

Hi Jeff,

 

Thanks for the response. I'm still pretty new to powerapps and formulas so I'm not sure how to implement your solution. I copy and pasted the formulas but the gallery wouldn't show anything when I did. Not sure how to proceed from there. 

 

Regards,

 

ddas

ddas
Helper II
Helper II

I changed the formula to this, Filter('2019 Goal Settings Form', 'Employee Name'=User().FullName || 'Created By'.Email=User().Email || 'Manager Name'=User().FullName) and now it is working. 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,295)