cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ChiefArawak
Level: Powered On

Unable to use User().fullname to filter content by user.

We call it a timesheets app that allows to fill in hours spent on client projects.

On the first screen users can see all the timesheets in the system including those of other employee.

 

To prevent I am trying to use User().fullname to filter the timesheet records. Im getting an error which says "The local evaluation may produce suboptimal or partial results. If possible, please simplify the formula."

 

It filters the timesheets on my computer in the editor however causes an unknown error when runnnig the app from another device/account.

 

Here is the code/formula: Sort(If(IsBlank(TextSearchBox1.Text), Filter('Timesheet Lines', LookUp(Users,systemuserid = _tgm_employeeid_value, fullname) = User().FullName), Filter( 'Timesheet Lines', TextSearchBox1.Text in tgm_name )), "tgm_date", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)).

 

All suggestions appreciated.

5 REPLIES 5
PowerKees
Level: Powered On

Re: Unable to use User().fullname to filter content by user.

We are dealing with the same question. Is it possible to give a basic formula how to filter the items which are stored in the passed by the current user?  Thanks in advance for helping. Kees Barlagen Noorderpoort 

ChiefArawak
Level: Powered On

Re: Unable to use User().fullname to filter content by user.

I'm not totally sure what you're asking but I think it depends on what you want to filter by. Sounds like you might want to look into using the ClearCollect function.

Community Support Team
Community Support Team

Re: Unable to use User().fullname to filter content by user.

Hi @ChiefArawak,

 

The error message should be in blue underline, which means the formula you used is not supported for delegation:

Understand delegation in PowerApps

 

Besides, for the unknown error, could you please share more details here?

Just look into the formula, it seems it would need to query two table, "Timesheet lines", and the "Users" table, please make sure users are all have permission to view the data in those two tables.

 

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.
PowerKees
Level: Powered On

Re: Unable to use User().fullname to filter content by user.

I found out that the function Search(BPV;'Office365-gebruikers'.MyProfile().Mail; "Email_x0020_stdnt") is working, but I stil gett the warning that external evaluation is not fully reliable, and the advice is to simplify the formula.

The amount of rows per user is however very small (max 15). SO I assume that I can ignore the warning.

 

ChiefArawak
Level: Powered On

Re: Unable to use User().fullname to filter content by user.

Thing is I looked at the list of delegable functions before posting on here. The FIlter, Sort, Lookup, SortByColumns and If functions are all delegable. It could just be that the search formula is too complex or complicated and is just slow in general. I'll look into revising it some how. I think its possibly the Lookup to the User entity which is slowing down the query. The reason I did that though is because the 'Timesheet Lines' entity has an Employee lookup field and I just cant figure out a way to access the value in the Employee lookup field.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 169 members 4,682 guests
Please welcome our newest community members: