Help on the SNC.canvas.interactiveFilters.setDefaultValue function

Alec Hanson Bay
Tera Contributor

I have an example custom interactive filter example that applies the dashbpoard handler, but just before hand calls a setDefaultValue function:

SNC.canvas.interactiveFilters.setDefaultValue({ id: filter_message.id, filters: [filter_message] }, false);
dashboardHandler.publishFilter(filter_message.table, filter_message.filter);

Can anyone help me understand what the "SNC.canvas.interactiveFilters.setDefaultValue" function is doing?

Thanks

3 REPLIES 3

Adam Stout
ServiceNow Employee
ServiceNow Employee

I believe it saves the value as a preference.  However, defaults are not supported by interactive filters.

https://docs.servicenow.com/bundle/newyork-performance-analytics-and-reporting/page/use/dashboards/r...

 

Thanks Adam.

Yes am aware of not being able to have a default. I was actually trying to understand if that or any other associated function would retain values, which I know are not supported as per the limitations.

I believe it saves them to the database, but the problem is that the defaults are ignored when the dashboard loads (you have to add your own logic to force it to be used after the filter renders).