We have to show /hide a widget if particular filter is selected and a user is from a specific region. how can we achieve the same?
Can we hide/show a widget based on filter selection?
Hello @mitsu.mehta,
This is possible but please provide more details about your case.
What does it mean “user region”? You are referring to the user culture in Dundas or browser culture?
Which type of filter do you have and what is the logic from behind?
Hey Costin,
Thanks for your response.
Consider i have 3-4 filters
Region (America,Japan,China etc…).
Other filters are brand category, Customer ID, Year
Now we want to implement a widget for America region only and also if users have selected some values from customer id than and only than the widget should be visible.how can we achieve this?
Hello @mitsu.mehta,
I hope I’ve understand it correctly Please see the script(it’s a draft) from below.
Note: The if which contains the OR operator can be converted in a for function which iterates all the customer ID’s required.
debugger;
var region=parameterHierarchy1.control.parameterValue.values[0].uniqueName.split(".")[0];
var numberSelectedcustomerid=parameterHierarchy3.control.parameterValue.values;
var i=0;
if(region==“America”)
{
for(i=0;0<numberSelectedcustomerid;i++)
{
var Selectedcustomerid parameterHierarchy3.control.parameterValue.values[i].uniqueName.split(".")[0];
if(Selectedcustomerid==“Specific customer1” || Selectedcustomerid==“Specific customer2” )
{
YourElement.hidden=false;
}
}
}
Thanks for your reply. How can i hide the widget if the token value All (All values by default ) are selected.