Hi.
On Microsoft visio, I've got a select list with this shape data:
Title => SetVar
Type => String
Value => MYValue:Value1:value2:value3|
It' simplified becaused I've got A big list of values
Then it create me a box with a scroll bar. Until here all is fine.
But I need when MYValue is egal to Value 1 to set 4 other values.
In the same way when MYValue is egal to Value 12 , the 4 other values must change.
How could I do this?
Many thanks
Hi Henri, I might be wrong but there's no straightforward way to easily accomplish this. I'm not saying, it is not possible, but it'll require some tricks to get there.
There are also some details we're missing to give you the full solution, but either way here's an idea of how you could get it to work (and possibly tweak it where necessary).
In my proposal, I'm making use of the following: Configuring a page to update a session variable when another session variable changes | DataMiner Docs. With this functionality, you can set a session variable with dynamic content. Whenever the dynamic content changes, the variable gets updated.
Example: Make a new Shape Data field on the page level:
- Execute: Set|Variable|TempVar|[var:myVar]|SetTrigger=ValueChanged
Whenever the session variable 'myVar' changes, it will be filled into the session variable 'TempVar', i.e. TempVarwill be a copy of myVar.
Now you only want to change another variable whenever myVar is equal to something, i.e. you only want to trigger the above statement in certain cases. Possibly you also don't want any of the content of the value of 'myVar' in the content of the resulting session variable. To overcome this, you'll need to make use of the following placeholder: [RegexReplace:x,y,z].
Again, not all details of how you see this are in the question, but let's assume the following: 'if 'myVar' changes to 'value1' then (and only then) I want to trigger a change. You could see this as an 'if-statement' which you can implement by using two times the regexreplace placeholder:
Set|Variable|TempVar|[RegexReplace:[var:myVar],[RegexReplace:^value1$,[var:myVar],myValue1Changed],[var:TempVar]]|SetTrigger=ValueChanged
If myVar now changes to 'value1', TempVar will have the value 'myValue1Changed', otherwise, it will keep its value. The same applies to doing it for another value, e.g. 'value4' in my conclusion below.
Now the last step is to set the output session variable 'ResultVar1'. The same format is applied and is again an 'if-statement'. If TempVar changes to 'myValue1Changed', it will set the variable 'ResultVar1' with 'newvalue1.1' and otherwise keep its content. The same again applies to the other session variable.
Set|Variable|ResultVar1|[RegexReplace:[var:TempVar],[RegexReplace:^myValue1Changed$,[var:TempVar],newvalue1.1],[var:ResultVar1]]|SetTrigger=ValueChanged
In the end, you will have the following shape data on the page level:
- Execute: Set|Variable|TempVar|[RegexReplace:[var:myVar],[RegexReplace:^value1$,[var:myVar],myValue1Changed],[var:TempVar]]|SetTrigger=ValueChanged-Set|Variable|TempVar|[RegexReplace:[var:myVar],[RegexReplace:^value4$,[var:myVar],myValue4Changed],[var:TempVar]]|SetTrigger=ValueChanged-Set|Variable|ResultVar1|[RegexReplace:[var:TempVar],[RegexReplace:^myValue1Changed$,[var:TempVar],newvalue1.1],[var:ResultVar1]]|SetTrigger=ValueChanged-Set|Variable|ResultVar1|[RegexReplace:[var:TempVar],[RegexReplace:^myValue4Changed$,[var:TempVar],newvalue4.1],[var:ResultVar1]]|SetTrigger=ValueChanged
Of course, there could be other options, e.g. doing the logic through Automation or a connector, but here's a Visio-only solution presented. If you want now to add more ResultVar's then it's a matter of copy/paste.
Kind Regards,
Jarno
You're rigth Jarno! Thanks a lot.
It change my existing variables. With this solution I could retrieve from Visio file a lot hard coded values that are present in my previous Visio.
Thanks a lot.
Kind regards
Henri
Hi Henri,
Based on your input, I think an Automation Script is more appropriate. You cannot launch an Automation Script when you select an item in the list. But you can introduce a 'Confirm' button which will launch an Automation Script and does the magic with the input you provide (i.e. the selected item in the dropdown list).
In your script, you can then use the following functionality to Add or Update session variables: Passing Automation script output to session variables
Hopes this helps you further!
Jarno
I thanks a lot. but I've got more than 50 variables and more than 10 results to change for each one.
May be is there a better solution by an automation? Launch a script when variable change. But I don't know how to change my 10 results values (that will be used on the Visio), with the script.
Kind regards
Henri
I was also going to suggest this approach and believe this is the best option we have at this moment.