cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
New Member

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 

Highlighted
Regular Visitor

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.

Highlighted
Community Support
Community Support

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.
Highlighted
New Member

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.

 

Highlighted
Regular Visitor

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,869)