{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":42683,"path":"platform-user-interface/t_DynamicFilterOptions.md","title":"Create a dynamic filter option","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a dynamic filter option\n\nDynamic filter options enhance filtering by allowing users to run existing script includes or JavaScript against a reference field within condition builders and dynamic reference qualifiers.\n\n## Before you begin\n\nRole required: admin\n\n## About this task\n\nThis task describes how to create a new dynamic filter option and an associated script include.\n\nDynamic filter options \"objectize\" script includes/JavaScript, enabling them to be reused in multiple [condition builders](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-user-interface/c_ConditionBuilder.md) and dynamic Reference qualifiers. This type of filter enables you to modify a script once and have the changes automatically take effect everywhere the dynamic filter option is used.\n\nWhen defining a dynamic filter, you can:\n\n-   use an existing **is \\(dynamic\\)** dynamic filter option \\(condition builder only\\)\n-   use an existing dynamic filter option \\(OOB or custom\\)\n-   create a new dynamic filter option and script include/JavaScript\n\nAll condition builder dynamic filters use the **is \\(dynamic\\)** operator and call a dynamic filter option. In the following example, the pre-existing dynamic filter option **Me** is being used. For a list of available pre-existing condition builder dynamic filter options, see [Dynamic operators](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-user-interface/r_UsingTheDynamicOperator.md).\n\n**Note:** Dynamic filters are supported in scoped applications, but they are not supported in UI policy conditions.\n\n\\[Omitted image \"DynamicOperands.png\"\\] Alt text: Dynamic operands\n\n## Procedure\n\n1.  Create a scripted filter as a client-callable script include or business rule.\n\n2.  Navigate to **System Definition** &gt; **Dynamic Filter Options**.\n\n3.  Select **New**.\n\n4.  Complete the form.\n\n    |Field|Description|\n    |-----|-----------|\n    |Label|Enter a descriptive name for the dynamic filter option.|\n    |Script|Enter the name of the function you created, JavaScript \\(no script include needed\\), or the complete script include/business rule call, such as `new GlobalCanvasUtil().refQualPaTabs()`.|\n    |Field type|Select **Reference**.|\n    |Referenced table|Select the table to which this dynamic filter option applies.|\n    |Order|Enter a number to designate the placement of this dynamic filter option in the filter option choice list.|\n    |Roles|Select the role a user must have to see this option.|\n    |Active|Enable or disable the option.|\n    |Reference script|Optional. Select the client-callable script include or business rule you created for the scripted filter. If the **Script** field contains JavaScript, an encoded query, or the entire script include/business rule reference, this field can be empty.|\n    |Available for filter|Select this option to display the dynamic filter option as a filter breadcrumb.|\n    |Available for default|Select this option to allow dynamic filter option to be a default in a dictionary entry.|\n    |Available for ref qual|Select this option to allow dynamic filter option to be selected as a dynamic reference qualifier.|\n\n    **Note:** Dynamic filters using Table API GET methods in scripts only work when using the same user configured in the basic authentication profile. To allow multiple users access to the dynamic filters, use global JavaScript APIs such as GlideRecord and GlideQuery APIs instead.\n\n5.  Select **Submit**.\n\n\n**Parent Topic:**[Filter admin functions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-user-interface/filter-admin-functions.md)\n\n**Related topics**  \n\n\n[Create and edit filters]()\n\n[Delete filters]()\n\n[Create scripted filters]()\n\n"}}