Setting up variables for dashboard queries


As a tenant administrator or editor, configure variables, which work as placeholders for values that you can use in dashboard queries and panel titles. Instead of hard-coding details such as server name or application name, use variables in your queries so that the system picks up the details at run time.

You can see variables in dropdown lists at the top of a dashboard.


To add a variable

  1. On any dashboard, click Dashboard settings dashboard_settings_icon.png.
  2. On the left navigation bar, click Variables.
  3. On the Variables page, click New.
  4. Depending on the variable type that you select, add the remaining options. For more information about variable types, click here.

  5. Click Add.
  6. On the left navigation pane, click Save dashboard.

Important

For Service Management queries, when Query is selected as the Type, you need to specify the SQL query variable in a specified format. Here is an example of the SQL query variable format:

remedy,{"sql": "Select Distinct case when `CHG:Infrastructure Change`.`ASGRP` is not null then `CHG:Infrastructure Change`.`ASGRP` else 'Unknown' end from `CHG:Infrastructure Change` limit 500"}


To manage variables

On a dashboard, click Dashboard settingsdashboard_settings_icon.png.

On the navigation pane, click Variables, and perform the following tasks:

Task

Procedure

Copy a variable

Click Duplicate Variable copy_variable.png against a variable. You can see the variable copied on the same page.

Click the copied variable and edit it as required.

Edit a variable

Click a variable.

Make your changes and click Update.

Delete a variable

Click Remove Variable delete_variable.png against the variable that you want to delete.

On the navigation pane, click Save dashboard.

To configure the variable for supported report formats

As a tenant administrator or editor, configure the supported report formats for any of the out-of-the-box BMC Helix ITSM Printable dashboards or any custom dashboard using the supported_report_types variable. After you specify the supported report formats by using this variable, users will only see those formats when they download or schedule reports:

  1. On a dashboard, click Dashboard settings dashboard_settings_icon.png.
  2. On the navigation bar, click Variables.
  3. Click supported_report_types variable from the list of variables.
  4. From the Hide menu, select Variable.
  5. In the Values separated by comma field, specify the supported report types, separated by commas, and click Update. 
    For example, specify PDF,XLS,CSV to enable users to download dashboards or schedule reports in all three formats. 

Important

CSV report format will export only the table-type panels. 


To filter the Service Dashboard by services

As a tenant administrator or editor, filter the Service Dashboard by services. By default, the Service Dashboard displays data for the business services that are present in your tenant. By using variables, you can choose to display the metrics either for business or for technical services. 

  1. On the Service Dashboard, click Dashboard settings dashboard_settings_icon.png.
  2. On the navigation bar, click Variables.
  3. Create a new variable and configure the following options:
    • Name—Specify a name for the variable.
      For example, let's specify serviceName as the name of the variable.
    • Type—Select Query.
    • Label—Specify a label. 
      For example, let's specify Service Name.
    • Query—Specify the following query to display the business services in your tenant:

      smartgraph,{"query":"search BusinessService show #id,name","displayName":"name"}
  4. Click Update.

Important

To build queries for filtering services, see Logical and arithmetic expressions in BMC Discovery documentation.

Examples

  • Specify the following query to display the list of business services that are mentioned in the query:

    smartgraph,{"query":"search BusinessService where name in ['KM Service', 'Windows Service'] show #id,name","displayName":"#id"}

    where the data is displayed for the KM and Windows services.

  • Specify the following query to display all the business services that contain Windows in their names:

    smartgraph,{"query":"search BusinessService where os_type has subword "Windows" show #id,name","displayName":"#id"}


To display the filter data with NULL values

As a tenant administrator, filter data that contains NULL values in a dashboard. This information can help you identify missing data or incomplete records in a dashboard. 

Important

This option applies to the Service Management query type only, and works with BMC Helix ITSM 21.3.06 and above.

  1. On a dashboard, click Dashboard settings dashboard_settings_icon.png.
  2. On the navigation bar, click Variables.
  3. On the Variables page, click the appropriate filter variable for which you want to filter the data.
  4. In the next screen, select Include all option and enter the following GUID in the Custom all value field:
    'ARJDBC6460AC66AB204CA7BE8869BB9AF532F9'
  5. Select Apply > Save dashboard.

    null_variable_23_1_02.png


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*