Dynamic JavaScript filters
-
- UpdatedAug 3, 2023
- 5 minutes to read
- Vancouver
- Dashboards
Create dynamic conditions in JavaScript that you can configure as part of a report visualization's criteria instead of specified values.
To create a report using a dynamic conditional statement, you place a JavaScript URL in the conditional value statement of the filter. You can enter a JavaScript command directly into the field, but for a script longer than one statement, the script should be placed in its own record. You then call a function from that record in the value field of the report condition.
Add a dynamic JavaScript filter
Add a dynamic JavaScript statement for evaluation as part of a report visualization's filter criteria.
Before you begin
Role required: itil, report_user, report_group, report_global, report_admin, or admin. To create a meaningful report, you must have the right to access the data you want to report on.
About this task
JavaScript filters can be single-line statements, or longer scripts. For longer JavaScript statements, create a script include that returns the correct format and data type, conforms to the specific data that the report should filter for, and is client callable. For more information, see Script includes.
Procedure
What to do next
After you add the necessary JavaScript statements and conditions and configure the remainder of the report, test the report to ensure it returns and displays the expected results.