Hi,
I would like to be able to filter a Visio shapes drop down choices. The Visio populates the drop down list Shape data from another Elements table cell like this:-
SetVar PlayoutServer[property:x20IRS_Output_Port_PRI]=[param:AppearTV_X20_Utilities,1014,[property:x20IRS_PRI_ElementName]]
The drop down list is populated with the contents of table column id 1014, on the row that matches [property:x20IRS_PRI_ElementName]. The table cell contents are 'source1:source2:source3:random4'.
I would like to filter the drop down list using another Visio shape that has a Shape Data of:-
SetVar SearchFilter[property:x20IRS_Output_Port_PRI]
After many attempts with ':', '|', 'regex' and conditional <A> and <B> I cannot find the correct string to perform the filtering.
I am running Dataminer 9.6 CU13.
Thanks.
Jon
Hi Toon, I would like to filter the ‘source1:source2:source3:random1’ items in the Visio drop down, matching by the equivalent of a C# ‘Contains’. So if the Variable SearchFilter=source then ‘source1’, ‘source2’ and ‘source3’ would be displayed in the drop down but not ‘random1’
A regex should do the trick. A colleague of mine tested with this one and that seemed to work:
(?<source>[^:]*source[^:]+:?)|(?<alt>[^:]+:?)
If you want "source" to be a dynamic part that the user can enter, you can add a SetVar shape to your Visual Overview, with shape data SetVar set to "SearchFilter". This will show a textbox in which the user can then enter things.
You can then replace the "source" above with a var placeholder "[var:SearchFilter]"
Your full placeholder then becomes [regexreplace:(?<filter>[^:]*[var:SearchFilter][^:]+:?)|(?<alt>[^:]+:?),[param:AppearTV_X20_Utilities,1014,[property:x20IRS_PRI_ElementName]],${filter}]
Edit: If you want your regex to be case insensitive, it should suffice to add "(?i)" in front of your regex. Your full regex is then [regexreplace:(?i)(?<filter>[^:]*[var:SearchFilter][^:]+:?)|(?<alt>[^:]+:?),[param:AppearTV_X20_Utilities,1014,[property:x20IRS_PRI_ElementName]],${filter}]
Hi Toon, I don’t understand sorry. Where does my Visio parameter that the user can enter fit into the string?
Without the regexreplace would the full Visio Shape Data be:-
SetVar PlayoutServer[property:x20IRS_Output_Port_PRI]=[param:AppearTV_X20_Utilities,1014,[property:x20IRS_PRI_ElementName]],${SearchFilter[property:x20IRS_Output_Port_PRI]}]
Where SearchFilter[property:x20IRS_Output_Port_PRI] is a SetVar Shape Data on another shape.
Also the list of choices might not literally be source1:source2 but rather strings like:-
VP_TEST_CH07
VP_TEST_CH08
Test_LoopAround
I would like to enter ‘VP’ into the searchFilter SetVar and have it find VP_TEST_CH07 and VP_Test_CH08.
I wasn’t aware that your filtering was based on user output. The answer was edited, hopefully completing the solution.
Also note that in the comment above you posted something in the following syntax “varname=” while the syntax for a dropdown is “varname:”
Hi Toon, Apologies for the confusion. The new string and varname: syntax change is now filtering the drop down list. Thank you so much!
Hi,
If we needed to make the search filter case insensitive where would we put the Regex ‘i’ modifier?
As far as I can tell from documentation, your /i modifier comes at the end of your regex pattern. The syntax for the regexreplace is [regexreplace:pattern,input,replace], so it would come at the end of your pattern part.
Could you specify what you want to filter and what the result should be in your filtered dropdown?