Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

DashboardMessageHandler

Provides methods to define custom filtering logic for interactive filters.

For more information about interactive filters, see reporting and interactive filters.

Parent Topic:Custom interactive filters

DashboardMessageHandler - DashboardMessageHandler(String id)

Instantiate a DashboardMessageHandler object with a given unique ID.

NameTypeDescription
IdStringA unique ID for the filter. This ID allows report widgets to track which filter applied each filter. The ID does not need to be unique across all dashboards, but each dashboard cannot have multiple filters with the same ID.
var my_dashboardMessageHandler = new DashboardMessageHandler("my_unique_id");

DashboardMessageHandler - publishFilter(String table, String encodedQuery)

Each DashboardMessageHandler object can publish a single filter.

Publishing a new filter from the same object overwrites the original filter. Use multiple DashboardMessageHandler objects to publish multiple filters.

NameTypeDescription
tableStringThe table to filter, such as task.
encodedQueryStringAn encoded query that specifies the filter to publish.
TypeDescription
void 
var my_dashboardMessageHandler = new DashboardMessageHandler("my_unique_id");
<input id="onlyMine" type="button" value="Only mine" 
  onclick="my_dashboardMessageHandler.publishFilter('task','caller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe');"/>

DashboardMessageHandler - publishMessage(Array filters)

Apply a custom interactive filter to multiple tables.

NameTypeDescription
filtersArrayArray of filter objects that define the tables to filter and the filter criteria.
[
  {
    "table": String,
    "filter": String 
  }
]
filters.tableStringName of the table to filter.
filters.filterStringEncoded query containing the filter criteria to apply to the table.
TypeDescription
None 

This jelly script filters the Incident and Problem tables to return records where the assignment group is Problem solving.

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
 var dmh = new DashboardMessageHandler("aha_dmh");
 var filter = "cmdb_ci.sys_idINcdafbfc9db8f570466e0a345ca96198a"; 
 //this is the encoded query string
 var fullFilter = dmh.getFilterMessage('change_request',filter); 
 //creates a JSON object

 SNC.canvas.interactiveFilters.setDefaultValue({id: dmh.aha_dmh, filters:[fullFilter],}, false);
 var published = dmh.publishMessage([fullFilter]);
</script>

</j:jelly>

DashboardMessageHandler - removeFilter()

Removes the current filter published by this DashboardMessageHandler object from all reports on the dashboard.

NameTypeDescription
None  
TypeDescription
void 
var my_dashboardMessageHandler = new DashboardMessageHandler("my_unique_id");
<input id="removeFilter" type="button" value="Remove filter" 
  onclick="my_dashboardMessageHandler.removeFilter();"/>