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.
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
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.
The error message should be in blue underline, which means the formula you used is not supported for delegation:
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.
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.
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.
Featuring samples like Return to the Workplace and Emergency Response Applications
We're excited to announce our first cross-community 'Can You Solve These?' challenge!
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
We are excited for the next Super User season.
Features releasing from October 2020 through March 2021