.. _model-filter-criteria:


Model Filter Criteria
------------------------

.. _21.1|VOSS-847:


Model filter criteria defines how the MSOL user is matched to corresponding data in 
VOSS-4-UC, and allows users and related data to be moved to the correct system levels (customer 
or site) on import (in a sync or overbuild), based on attributes defined for the user in Microsoft 
Azure. 
  
Administrator users with access to the ``data/ModelFilterCriteria`` model
can manage instances of this model so that these are available for selection
in the Site Defaults Doc of a site. 

The Site Defaults Doc provides a **MS 365 User Model Filter Criteria** drop
down field to select the created model filter.



Create a Model Filter
......................

1. Identify the source and target model and field that will be used
   in the filter.
#. Go to (default menu) **Customizations > Model Filter Criteria**.
#. Click Add to add a new record, or clone an existing model filter critera and update it 
   to create a new model filter. 
#. Provide a **Name**, **Description**, and **Usage** (e.g. Overbuild)
   for the filter.
#. From the **Type** drop-down, select the source model, for 
   example ``device/msgraph/MsolUser``.
#. Click the Plus sign (+) in the **Criteria** group to add one or more criteria.

   Each criteria is defined by the following:

   ====================== =============================================================================
   **Field**              **Description**
   Unary Operator         None, or NOT: to operate on the match **Condition** with the target value

   Attribute              The field from the source model, for example ``City`` from 
                          ``device/msgraph/MsolUser``.

   Condition              Options are exact and non-exact types of contains and equals, as well as 
                          a regex search option.
   Value                  The target value that identifies the site in VOSS-4-UC. The value can 
                          also be a named macro, for example, ``{{ macro.OVERBUILD_SITE_CITY_NAME }}``.

   Conditional Operator   AND or OR: only needed and used to indicate the type of Boolean combination 
                          with the following criteria instance, if an additional instance is added.
   ====================== =============================================================================

#. Save the model filter. 

   The new model filter will now be available for selection in the 
   Site Defaults Doc of a site, and will for example be applied in the Microsoft overbuild if
   **Include Site for Overbuild** and **Microsoft Users** is enabled.

   When running the overbuild, the system loops through the site defaults to identify sites 
   with **Include Site for Overbuild** enabled, and moves related user data to the site 
   based on the chosen model filter criteria rule.

   In this example, all ``device/msgraph/MsolUser`` instances synced in will be moved to
   the site matching ``{{ macro.OVERBUILD_SITE_CITY_NAME }}`` if their ``City`` value matches.



Related Topics
...............

* 
  .. raw:: latex

     Microsoft Overview in the Core Feature Guide

  .. raw:: html
  
     <a href="concepts-microsoft-overview.html">Microsoft Overview</a> 

* 
  .. raw:: latex

     Sync with Flow Through in the Core Feature Guide

  .. raw:: html
  
     <a href="concepts-sync-with-flow-through-for-microsoft.html">Sync with Flow Through</a>