I'm working with a visio where we filter a table in an element to grab some cable modem metrics (e.g. Total, # offline, % offline) based on the manufacturer of the cable modem. The filter looks like such:
1401:*[cardVar:_CabModManufacturer]*
The card variable is set by another shape. You can see it in action below:
However, if I remove the filter, the data gathered remains:
How can I remove the old data so it is empty if the filter is removed?
I tried doing an Execute on the page level to replace the variable with "N/A" so the filter wouldn't work (no matches in the table), but the old data is still there. See below:
Any help is appreciated, thanks!
A solution like the one you proposed at the end of your question should work. Try making an intermediate variable and using a regexreplace in your execute page data to turn it into N/A when the variable is empty.
Here's how I did it and the result below it both for an empty filter and one that's filled in.
As a follow up:
What happens is a filter that yields no results also sends no event from the server to the client. So no update to the value happens if you use a filter like *N/A*.
A solution would be to hide the shape when the filter is empty and show a different one (e.g. “no filter specified”) with a show condition on the same thing.
Thanks once again for the help Toon! Hope others get use out of this as well.
Hi Toon, thanks for the reply.
What you said is exactly what I tried, but the Regex was slightly different. See here:
SET|CardVariable|_CabModManufacturer|[RegexReplace:^(?![dD]),[cardVar:CabModManufacturer],N/A]|SetTrigger=ValueChanged
I unfortunately can’t paste more pictures here (in a comment), but they will be similar to whats shown above. However the results are still the same, the old data is shown after I display the variable. I will email you the pictures as a follow-up, and see if I can add them to the original question.