Create parameters that you can use in all of your widgets with an AQL or Generic API data
source, such as Time Period and Time Value. Using common
parameters and default values can reduce the time that it takes to create or edit individual queries
for your widgets.
Before you begin
Parameters appear within curly braces, as in the following AQL example:
Because curly braces are also used in an AQL statement within a quoted string (a string literal
between quotation marks), you must use a backward slash (\) as an escape character before the
opening curly brace within a quoted string. This syntax ensures that the quoted string is not
interpreted as a parameter and cause incorrect query results. If you have a backward slash in a
quoted string, add an extra backward slash as the escape character.
Procedure
-
From a dashboard that contains AQL-based or Generic API-based widgets, such as the Cases dashboard, click the dashboard menu ().
The window
displays the parameters that are already created in your workspace. If any of the parameters have
default values, they're listed in the Value column.
-
To set a default value for a parameter, click
the Edit icon, select a value from the Default value
list, and then click Save.
Notes:
- This action sets the default value for every widget that uses the parameter, and the
Parameters card automatically updates. Alternatively, you can add a value for
the parameter in specific widgets.
- When you change the default value for a
parameter, you're changing the value everywhere the parameter is used in your workspace, except in
expanded dashboards and widgets. If you don't set the value as the default value, the updated
change applies only to the current session. However, if you set the value as the default, the
current session value also uses that value.
- The predefined SYSTEM:accountId parameter returns the
account ID of the user who is logged in. This parameter is read only and you cannot change the
default value.
- The predefined SYSTEM:timerange parameter represents the time selector
value.
-
To add a parameter to your workspace, click Add new parameter.
- Choose the parameter type.
- Text
- Enter a default value in the text box.
- Query
- Select a value from the result set of the query.
A query-type parameter must include a valid
KQL query that returns results. The Default value section displays the query
results, so you might see the same value more than once in the list.
- Custom List
- Select a value from a custom list that you add to the parameter. You must include at least one
custom value in the parameter to save it.
Tip: You can change the parameter type when you edit a parameter.
- Give the parameter a name and default value, and then click Save.
-
Before you delete a parameter, check that it doesn't belong to any widgets by hovering over the
Number of occurrences for the parameter to see the names of widgets that use
it. After you remove the parameter from those widgets, then you can click
Delete.
- Click Close to return to the main view and continue your
work.