Blog

SharePoint - Filtering lists by User() is now delegable

A common requirement is to filter SharePoint records by the email address of the current user. In the past, this task could be difficult because filtering lists by User().Email was not delegable. The good news is that Microsoft has now improved this behaviour and is post describes what's new.

A very common question from app builders is how to filter records in SharePoint lists that were created by, or modified by the current user.

The problem that used to exist

The screenshot below illustrates the problem that used to exist. Taking the example of a SharePoint list of property records, if we were to filter the records that were created by the currently logged on user, the formula beneath would result in a delegation warning:

Filter(Property,
'Created By'.Email = User().Email
)

There are more details in my post here, including the workarounds that were previously necessary.

http://powerappsguide.com/blog/post/sharepoint-how-to-filter-records-by-the-current-user

The new improved behaviour

The great news is that following an update to Power Apps, if we were to attempt to use the same formula today, the expression is now delegable and does not result in any warnings (shown in the screenshot below). To confirm this behaviour, I reduced the 'Data row limit' setting and was able to confirm that the filter expression returned all the expected records in a delegable way.

Conclusion

Up till now, it wasn't possible to filter fields from a SharePoint list by User().Email. An update to Power Apps has now resolved this issue. This is great news because this was a frequent problem that new app builders encountered when they wanted to filter lists by records that were created or modified by the current user.