web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

addCustomFilter to Owner field in Dynamics 365 Online

(0) ShareShare
ReportReport
Posted on by 4

Hi all,

I have had success using the addCustomFilter functionality on a lookup field with one table type (e.g. filtering an account lookup field) but I am unsure of how to make it work for the owner field which refers to both systemusers and teams.  Is this possible?

addCustomFilter (Client API reference) in model-driven apps - Power Apps | Microsoft Learn

Thank you!

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    If you want to add the filter to the user only table you can do the following:

    formContext.getControl("ownerid").addCustomFilter(filter, "systemuser");

  • Verified answer
    Steve Zhao2 Profile Picture
    Microsoft Employee on at

    Hi cjanow3,

    Yes, this is possible. Owner is a special lookup field, and it is associated with these two tables: user and team.

    So, if you want to filter both of these two tables. you need add two custom filter like this:

    function addCustomerFilter(executionContext){
    	var formContext = executionContext.getFormContext();
    	var owner = formContext.getControl("ownerid");
    	owner.addPreSearch(applyFilter);
    }
    
    function applyFilter(executionContext){
    	var formContext = executionContext.getFormContext();
    	var owner = formContext.getControl("ownerid");
    	var customerUserFilter = "";
        owner.addCustomFilter(customerUserFilter, "systemuser");
    	var customerTeamFilter = "";
    	owner.addCustomFilter(customerTeamFilter, "team");
    }
    

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 174

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans