.. _manage-number-filters:

Manage number filters
---------------------

.. _24.2|VOSS-1471:
.. _25.1|VOSS-1210:
.. _25.3|EKB-26436:
.. _25.4|EKB-27416:


.. tip:: 

   :ref:`use-action-search-to-navigate-automate`


Overview 
..........

Automate ships with a collection of pre-defined, read-only filters for the number inventory (shipped filters), 
and allows an administrator to also create their own :ref:`custom-inventory-filters`. When filtering is 
enabled at the hierarchy you're working at, number inventory filters can be selected to filter numbers from the 
number inventory for specified criteria.

.. note:: 

   Shipped number inventory filters are located at the system level (`sys`) and cannot be disabled, enabled, 
   or renamed. If you wish to enable or disable a shipped filter, you will need to clone that filter 
   to a lower level of the hierarchy. The cloned shipped filter then becomes a custom number inventory, but 
   it cannot be renamed.  

The image shows the **Manage Number Filters** page with a collection of custom and shipped inventory filters. 

.. image:: /src/images/manage-number-filters-list.png 


Applying a number inventory filter means that when assigning a number during onboarding or provisioning, 
you'll be able to select from a smaller selection of relevant numbers. Additionally, when used 
with **Use next available line**, the system can use the next available line from a filtered selection of 
numbers.

.. note:: 

   When using **Use next available line** functionality, the system prioritizes local numbers (numbers 
   available at the current site) before checking for available numbers from higher levels in the hierarchy. 
   If the user has *reserved numbers*, these are excluded and won't be applied as the 
   *next available line*.

Inventory filtering functionality in Automate can be summarized as follows: 

* Shipped filters cannot be enabled, disabled, or renamed. To enable or disable shipped inventory 
  filters you'll need to clone the shipped filter to a lower hierarchy, effectively creating a new custom 
  filter, but you won't be able to rename it. 
* Filtering is enabled by default, and only custom inventory filters can be disabled at specific hierarchies
* Provided filtering is enabled at the hierarchy you're working at, number inventory filters are available 
  anywhere in the GUI where line filtering exists, for example, Quick Add User.
* Only the read-only shipped filters are available until you create your own custom filters
* You can only enable or disable custom filters at a hierarchy, for example, at a specific site 
* Filtering is integrated with **Use next available line**.


.. rubric:: Related topics 

* :ref:`enable-disable-filtering`
* :ref:`custom-inventory-filters`
* :ref:`create-custom-inventory-filter`
* :ref:`inventory-filters-and-next-available-line`



Shipped inventory filters 
...........................

Shipped number inventory filters are available at install, located at the system level (`sys`), and are enabled 
by default. Shipped filters are pre-defined and read-only. To disable shipped filters at specific hierarchies 
you will need to clone the shipped filter down to a lower hierarchy and then disable the clone at that hierarchy.
Shipped filters can't be modified or renamed. Only the shipped inventory filters are 
available for your system until you create custom inventory filters. 

Automate's collection of shipped inventory filters are the following: 

* Show unused numbers 
* Show unused numbers (site only)
* Show unused numbers with associated E164s 
* Show unused numbers with associated E164s (site only)
* Show used numbers 
* Show used numbers (site only)
* Show numbers belonging to this subscriber

As an example use case scenario for shipped inventory filters, let's say you wish to see only numbers 
reserved for or 
belonging to a user you're provisioning, in this case, you can select the shipped inventory filter, 
**Show numbers belonging to this subscriber**. For details around *reserved for* numbers, see :ref:`ini-reserve-for`.


.. rubric:: Related topics

* :ref:`ini-reserve-for`




.. _custom-inventory-filters:

Custom inventory filters
.............................

Automate allows administrators to create their own customized number inventory filters to define the numbers 
that will be available for selection in drop-downs where lines are provisioned, such as Quick Add User. 
For example, you may want to make available only Microsoft numbers at a particular site, or to display 
only a selection of numbers greater than or equal to a specified value, for example, to display only numbers greater 
than or equal to `820100001`.

Whereas shipped inventory filters are located at the system level (`sys`) and available at all hierarchies, custom 
inventory filters are created at the 
hierarchy you're at and are only available at that hierarchy. For example, when a Provider admin creates a custom inventory filter at a particular site, 
that custom inventory filter is located at that site and can only be used at that site. A system administrator 
can however create custom inventory filters at `sys` level. 

The image shows the **Manage Number Filters** page with a collection of custom and shipped inventory filters. The 
custom inventory filters *Located At* value indicates the hierarchy where the inventory filter was created, 
*site* in this case. Green checkmarks indicate enabled inventory filters. You can click on a custom inventory 
filter in the list to enable or disable it, or to rename the custom inventory filter. 

.. note:: 
   
   A custom inventory filter cannot be given the same name as a shipped inventory 
   filter as the settings of the shipped inventory filter will then override any settings you configured for the 
   custom inventory filter. In this case, you will need to rename your custom inventory filter. However, 
   if the custom inventory filter is a clone of a shipped filter, this filter cannot be renamed as it is still 
   owned at *sys* level. 

   The name of a custom inventory filter must be unique at the hierarchy where it's located.

.. image:: /src/images/manage-number-filters-list.png 


.. rubric:: Custom inventory filters and saved search

Custom inventory filters are created at the hierarchy you're at when creating the filter, and can be used by 
any user at that hierarchy, provided the custom inventory filter is enabled at that hierarchy, at a specific 
site for example. Saved searches however, are personal filters created at the user's hierarchy and are only 
available at that hierarchy, for example, if a provider admin creates a saved search, that saved search is 
only available at the provider hierarchy. 





Enable or disable filtering and inventory filters
...................................................


Filtering is enabled/disabled via :ref:`global-settings` (**Number Inventory** settings). By default, 
inventory filtering is enabled in Automate but can be disabled (custom inventory filters only) 
at selected hierarchies or at system level. 

You'll need to 
ensure that filtering is enabled at the hierarchy you're working at to use the 
custom inventory filters in the drop-downs where lines are provisioned at that hierarchy, such as 
Quick Add User. 

When enabling number inventory filtering, you can choose to make all enabled inventory filters available 
(custom and cloned shipped inventory filters), or only shipped inventory filters. 
Specific custom or cloned shipped inventory filters at a hierarchy can also be disabled. 
For example, you may want to 
make some cloned shipped inventory filters available at a particular site and not at others.

.. note:: 

   All inventory filters are enabled at a hierarchy until you disable them. Only the read-only shipped inventory 
   filters are available until you add custom inventory filters.

.. image:: /src/images/global-settings-number-inventory.png


The image displays inventory filters enabled at Provider level with the filter group set to *All Enabled Filters*, 
while at a specific site, only *Custom Enabled Filters* will be available in the drop-downs.

.. image:: /src/images/config-filters-at-hierarchy.png


In **Manage Number Filters**, an administrator can enable or disable one or more cloned shipped filters or custom 
filters. In this case, even if the selected filter group is *All Enabled Filters*, you may want to 
disable specific cloned shipped or custom inventory filters at certain hierarchies.


.. rubric:: Related topics

* :ref:`global-settings`


.. _enable-disable-filtering:

Enable/disable filtering
''''''''''''''''''''''''''

This procedure enables or disables inventory filter functionality via the Global Settings in Automate.

.. note:: 

   Custom and shipped inventory filters available at a hierarchy can be viewed and managed (enabled/disabled) via 
   :ref:`manage-number-filters`, at that hierarchy.

1. In the Admin Portal, set the hierarchy to the level where you want to enable or disable 
   inventory filters.
2. Go to :ref:`global-settings`. 
3. On the **Number Inventory** tab/panel, at **Enable Filters**, choose an option: 

   =============== =========================================================================================
   Option          Description 
   =============== =========================================================================================
   Inherit         Sets the current hierarchy to use the setting from higher up in the hierarchy. The value for 
                   **Filter Group** then displays the value that will be used. 
   
   Yes             Default. Enables inventory filtering at the current hierarchy and exposes the **Filter Group** 
                   drop-down, where you can select the type of inventory filtering.
   
   No              Disables inventory filtering (custom filters only) at the current hierarchy. 
   =============== =========================================================================================

#. At **Filter Group**, select the type of inventory filters you wish to 
   use at the current hierarchy. Options are: 

   * Inherit 
   * Custom Enabled Filters 
   * Shipped Enabled Filters 
   * All Enabled Filters (default)

   .. note:: 

      The filter group value is populated based on the inherited setting if you've selected *Inherit*. 
      See :ref:`global-settings`. Only shipped inventory filters display until 
      you've created custom inventory filters at this hierarchy.

#. At **Include the Number Inventory description in all number drop-downs**, define whether to 
   include a description for numbers displaying in the drop-downs. 

#. At **Include the Number Inventory vendor in all number drop-downs**, define whether to include the vendor along 
   with the number in the drop-downs. 
#. At **Include the Number Inventory type in all number drop-downs**, define whether to include the type of the 
   number in the drop-downs.

#. Save your changes. 

   Once the transaction completes and you've set **Enable Filters** to *True*, users will have 
   the option to choose from the selected collection of inventory filters when assigning a line. 


.. rubric:: Related topics 

* :ref:`global-settings`
* :ref:`manage-number-filters`




.. _inventory-filters-and-next-available-line:

Inventory filters and "Use next available line"
.................................................


Custom and shipped inventory filters can be used with *next available line* functionality. 

When enabling **Use next available line** for provisioning, you can select a custom or shipped inventory filter 
to allow the system to choose the *first available line* from the collection of filtered numbers in the number inventory.

.. note::

   By default, **Use next available line** is disabled (checkbox is clear) and inventory filtering is enabled.

   When using **Use next available line** functionality, the system prioritizes local numbers (numbers 
   available at the current site) before checking for available numbers from higher levels in the hierarchy. 
   If the user has *reserved numbers*, these are excluded and won't be applied as the 
   *next available line*.

   When inventory filters are used with **Microsoft Quick User**, automatic line assignment using 
   **Use next available line** applies only to numbers where the Internal Number Inventory (INI) 
   **Vendor is set to Microsoft only**. Filtering does not override workflow-specific vendor eligibility. 
   Numbers configured with multi-vendor values (for example, Cisco, Microsoft) may be matched by a filter, 
   but are excluded from automatic assignment in Microsoft Quick User workflows. For vendor requirements when assigning lines 
   automatically, see  :ref:`qas-for-ms-users`.

.. image:: /src/images/number-inventory-filter-use-next-enabled.png


.. image:: /src/images/inventory-filter.png 

The table describes how **Use next available line** is integrated with inventory filtering:

.. note:: 

   When using **Use next available line** functionality, the system prioritizes local numbers (numbers 
   available at the current site) before checking for available numbers from higher levels in the hierarchy. 
   If the user has *reserved numbers*, these are excluded and won't be applied as the 
   *next available line*.

.. tabularcolumns:: |p{5cm}|p{10cm}|

+-----------------------------------------+----------------------------------------------------------------------+
| Setting                                 | Description                                                          |
+=========================================+======================================================================+
| "Use next available line" - ENABLED /   | * Select an inventory filter.                                        |
| Filtering - ENABLED                     | * The system selects the first available line from the filtered      |
|                                         |   subset of available lines included from the filter.                |
+-----------------------------------------+----------------------------------------------------------------------+
| "Use next available line" ENABLED /     | The system automatically selects the next available line from the    |
| Filtering DISABLED                      | number inventory.                                                    |
+-----------------------------------------+----------------------------------------------------------------------+
| "Use next available line" DISABLED /    | Select a line from an unfiltered list of available numbers in the    |
| Filtering DISABLED                      | **Directory Number** drop-down.                                      |
+-----------------------------------------+----------------------------------------------------------------------+
| "Use next available line" DISABLED /    | * Expand **Lines**.                                                  |
| Filtering ENABLED                       | * Select an inventory filter                                         |
|                                         | * Select a number from **Directory Number**                          |
+-----------------------------------------+----------------------------------------------------------------------+


.. rubric:: Related topics

* :ref:`qas-for-ms-users`






.. _view-filters:

View shipped and custom inventory filters
..........................................

You can view and manage all number inventory filters via the **Manage Number Filters** list view. 

* Shipped inventory filters are located at the system level (`sys`) and are by default available to all 
  hierarchies. Only cloned shipped inventory filters can be enabled or 
  disabled via **Manage Number Filters** but the inventory filter name is read-only and can't be changed.
* Custom inventory filters are created at and then located for and at a particular hierarchy level, for example, a 
  custom inventory filter created at a site is only available at that site (if enabled). Custom inventory 
  filters can be deleted and updated via **Manage Number Filters**, where the name can be changed and the 
  inventory filter can be enabled or disabled.

.. image:: /src/images/manage-number-filters-list.png




.. _create-custom-inventory-filter:

Create a custom inventory filter
.................................

This procedure creates a custom inventory filter at a specified hierarchy level. 

1. In the Admin Portal, set the hierarchy to the path where you want to create the inventory filter.

   .. note:: 

      The custom inventory filter will only be available at the hierarchy where it's created. 

2. Go to the **Number Inventory** list view.

   .. image:: /src/images/number-inventory-b4-custom-filter.png

3. There are two ways to create custom inventory filter criteria: 

   * Fill out inventory filter criteria at the top of the **Internal Number** column. Go to step 4.

     .. image:: /src/images/number-inventory-column-filter.png 
   
   * Click the toolbar **Filter** icon (funnel) to open the **Filter** dialog. Set up conditions 
     for the inventory filter, then click **Filter**. Go to step 4.

     .. image:: /src/images/create-custom-filter-funnel.png 

4. View the inventory filter and additional save and filter icons that now display at the top of the list view. 

   .. image:: /src/images/number-inventory-filter-icon.png 

5. Optionally, to modify the custom inventory filter before you save it, click on the inventory filter name to 
   launch the **Filter** dialog, where you can add or update inventory filter conditions, for example, to add 
   a condition for only including numbers greater than or equal to, or less than or 
   equal to the criteria you specified, or to add any other of the available conditions for filters. Click **Filter** to update the 
   custom inventory filter.

   .. note:: 

      By default, the custom inventory filter name is the column name and the filter criteria. You can click on the 
      custom inventory filter to change its name. Special characters, such as the wildcard character (*) are 
      supported. 

   .. image:: /src/images/number-inventory-custom-filter-conditions.png 

6. Click the toolbar **Filter** icon to launch a dialog where you can 
   confirm or update the inventory filter name before saving the new custom inventory filter.

   .. important::

      A cloned shipped filter cannot be renamed. All shipped inventory filters exist at `sys` level in the Automate hierarchy and are read-only. Admin 
      users with `sysadmin` privileges can also create custom inventory filters at `sys` level, but these 
      custom inventory filters cannot have the same 
      name as any shipped inventory filter since the settings from the shipped inventory filter with the 
      same name will override 
      any other settings you define for an inventory filter with the same name at `sys` level. 

   .. image:: /src/images/number-inventory-create-custom-filter.png

   .. image:: /src/images/number-inventory-custom-filter-rename.png

7. Click **Save** to confirm the custom inventory filter name and save the filter. 

   Once the transaction completes the custom inventory filter is enabled by default and is available in any 
   number inventory filter drop-downs where you're provisioning lines, at the hierarchy where the custom 
   inventory filter was created.

8. Go to **Manage Filters** at the hierarchy where you created the custom inventory filter to confirm that the 
   new inventory filter now displays in the list of filters for the hierarchy. 

   .. image:: /src/images/number-inventory-new-custom-filter-added.png 

   The custom number inventory filter you added can now be used in Automate wherever line filters are available, 
   for example, Quick Add Subscriber and Subscriber from Profile. 



Enable, disable, or rename custom inventory filters
......................................................

This procedure displays the collection of shipped and custom inventory filters at the current hierarchy, 
enables or disables custom or cloned shipped inventory filters, and renames custom inventory filters. 


1. In the Admin Portal, go to **Manage Number Filters**. 
2. Choose the hierarchy.  
3. View all custom and shipped inventory filters at the hierarchy you're at. The list view contains 
   the following details:

   ===================== =================================================================================
   Column                Description 
   ===================== =================================================================================
   Filter Name           The name of the inventory filter, read-only for shipped inventory filters.

   Enable Filter         Defines whether the custom inventory filter is enabled at the current hierarchy. 

   Located At            The location of the inventory filter in the system. Shipped inventory filters are 
                         at system level (`sys`), whereas custom inventory filters are created and 
                         located at the current hierarchy.
   ===================== =================================================================================

   .. image:: /src/images/manage-number-filters-list.png

#. **Do you want to** ... 

   * **Enable or disable a cloned shipped inventory filter or custom inventory filter**?
   
     * Click the inventory filter in the list view to open its settings. 
     * If the inventory filter is enabled and you want to disable it at the current hierarchy, clear the **Enable Filter** 
       checkbox
     * If the inventory filter is disabled and you want to enable it at the current hierarchy, select **Enable Filter**.
     * Save your changes.

     Drop-down lists that allow you to choose an inventory filter will now exclude any inventory filters you 
     disabled. 

   * **Rename a custom inventory filter**? 

     .. note:: 

        Only custom inventory filters can be renamed. Shipped inventory filters and cloned shipped inventory 
        filters cannot be renamed.  
   
     * Click a custom inventory filter in the list view to open its settings.  
     * Click in the **Filter Name** field, update the inventory filter name, then save your changes.



