Validation before entering filter value

Hello Helical Insight,

I am using helical insight enterprise edition 4.1 GA. What I want to do is that when a user is selecting the filter values, there should be a validation message which should appear. For example in search filter dropdown should have default selected value _ ALL _ is there we want user to select the data other then _ ALL _ .
Vvalidation we need to do at the time of submit if dropdown having _ ALL _ selected .User need to select the data in the search drop down.
Otherwise alert need to show please select the dropdown.

Thank You,
Sesa.

Hello Sesa,

We can get dashboard variables using
Dashboard.getVariable('VariableName')

In Dashboard Designer there is JS place holder to write javascript code
You can write on click on submit button get Dashboard variables values compare the values with ‘_ all _’
in this way we can validate filter values.

For example : Create a Dashboard with contains filter1 : travel_type , filter2: destination

  • Implementing validation of travel_type filter

If user keeps all value then it shows alert ‘Please select Travel Type’

Steps to be followed :

  1. Get the submit button id, like in our case the submit button id is 96imunmkbsm
  2. Open Dashboard in edit mode
  3. Provide the below JS code
$( "#96imunmkbsm" ).click(function() {

var filter1= Dashboard.getVariable('travel_type');

var filter2 = Dashboard.getVariable('destination');

if(filter1.includes("_all_")){
"Please select Travel Type"); 
}


});

Adding submit button in dashboard : Input Parameters with Submit Button - Helical Insight

Thank You,
Helical Insight.