<g:ui_date in Dynamic Content Block

Patrick Quinlan
Giga Guru

Hello Community....

Some of our delivery units have asked for interactive filters for their respective homepages so that they can dynamically filter the charts contained on the pages. Since we have not (and will probably not) purchased Performance Analytics, I am accomplishing this by building dynamic content blocks. 

 

The problem I am having at the moment, is that one of the groups would like some date driven filters. I was able to do this with a simple text input box, but they would like to utilize a date picker. I have attempted to use the following:

<g:ui_date_time id="${jvar_name}" value="${jvar_name}" />

This does give me a date/time picker which displays the calendar and allows a date to be chosen. The issue I'm having is that once you select a date, the field is populated with something similar to the following: $[g52.get5PMteFor36PMt()]

I'm assuming that this is some sort of encoded date but I'm unsure how to get it to display correctly. 

 

Any help is much appreciated.

5 REPLIES 5

Adam Stout
ServiceNow Employee
ServiceNow Employee

The docs for custom interactive filters state, "You must have Performance Analytics to create new interactive filters" so you may want to check with your sales rep before deploying any custom interactive filters.

Let me clarify...

I'm not creating true "interactive filters"

I'm utilizing the power of the dynamic content blocks to perform filtering on homepages. 

Below is one example of these interactive content blocks. 

<?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 incAlert_dashboardMessageHandler = new DashboardMessageHandler("incAlert");
 
function ClearincAlert(){	
	incAlertApp.checked=false;
	incAlertEmail.checked=false;
	incAlertNetCool.checked=false;
	incAlertSolar.checked=false;
	incAlertXymon.checked=false;
	incAlertOther.checked=false;
	
	incAlert_dashboardMessageHandler.removeFilter();		
}
//Catalog Task States
//Pending - "state=-5"
//Open - "state=1"
//Work In Progress - "state=2"
//Complete - "state=3"
//Incomplete - "state=4"
//Skipped - "state=7"

function ApplyincAlertFilter(){

	var FilterText = "";
	
//*************************************************************************************************************
//The following IF statements are used to build the Filter text based on which checkboxes the user selects.
//This will build a concatenated text string to be parsed into the filter when the user clicks ApplyFilter
//*************************************************************************************************************

	if (incAlertApp.checked==true){
		if (FilterText==""){
			FilterText = "u_alert_source=App Monitor";			
		} else {
			FilterText = FilterText + "^ORu_alert_source=App Monitor";
		}
	}

	if (incAlertEmail.checked==true) {
		if (FilterText=="") {
			FilterText = "u_alert_source=Email_Alert";
		} else {
			FilterText = FilterText + "^ORu_alert_source=Email_Alert";
		}
	}

	if (incAlertNetCool.checked==true){
		if (FilterText==""){
			FilterText = "u_alert_source=NetCool";
		} else {
			FilterText = FilterText + "^ORu_alert_source=NetCool";
		}
	}
	
	if (incAlertSolar.checked==true){
		if (FilterText==""){
			FilterText = "u_alert_source=SolarWinds";
		} else {
			FilterText = FilterText + "^ORu_alert_source=SolarWinds";
		}
	}
	
	if (incAlertXymon.checked==true){
		if (FilterText==""){
			FilterText = "u_alert_source=Xymon";
		} else {
			FilterText = FilterText + "^ORu_alert_source=Xymon";
		}
	}
	
	if (incAlertOther.checked==true){
		if (FilterText==""){
			FilterText = "u_alert_source=Other";
		} else {
			FilterText = FilterText + "^ORu_alert_source=Other";
		}
	}

	incAlert_dashboardMessageHandler.publishFilter('incident', FilterText);
	
}

</script>
	<b>ALERT SOURCE</b>
<li>
  <input id="allincAlert" type="button" value="All" onclick="ClearincAlert()" />
	</li><li>
  <input id="incAlertApp" type="checkbox" value="incAlertApp" onclick=""/> App Monitor
  </li><li>
  <input id="incAlertEmail" type="checkbox" value="incAlertEmail" onclick=""/> Email
  </li><li>
  <input id="incAlertNetCool" type="checkbox" value="incAlertNetCool"  onclick=""/> NetCool
  </li><li>
  <input id="incAlertSolar" type="checkbox" value="incAlertSolar" onclick="" /> SolarWinds
  </li><li>
  <input id="incAlertXymon" type="checkbox" value="incAlertXymon" onclick="" /> Xymon
  </li><li>
  <input id="incAlertOther" type="checkbox" value="incAlertOther" onclick="" /> Other
  </li><li>
  <input id="Filter" type="button" value="Filter" onclick="ApplyincAlertFilter()" />
	</li>

	

</j:jelly>

 

If you are using DashboardMessageHandler, you are creating a custom interactive filter which requires a Performance Analytics license.  I would recommend that you have a chat with your sales rep to ensure you don't have any compliance issues down the line.

I will research whether or not the use of the DashboardMessageHandler class without a PA license is some sort of violation. In the mean time, however, can you answer my original question regarding the use of the ui_date macro?

 

Thanks