I'm looking to set some variables upon a table being populated (through children) so I can use that on several objects in the visio. I've only seen how to set variables through the GUI though, so any more detail on how I can programatically set them would be great, including any links to documents I've not been able to find please.
I essentially want to compare two elements in a table, and if they match set the variable to 1, otherwise it'll be set to 0, I'll then use this variable to show/hide multiple elements of the GUI. I'm very new to this so advice on each of the three steps on this would be very useful please:
- How to set a variable without a user's input
- How to match two elements of separate tables (linked by a primary/foreign key) and get a 1 or 0 saved to a page variable based on that match
- How to show/hide elements based on the above variable being 1/0 (this one I've yet to look into but did briefly see on the video course - so more the two above I can't find anything on)
James
Hi James,
The answer to your first question is straightforward. You can find most information here:Turning a shape into a control to update a session variable | DataMiner Docs.
You should use the Shape Data:
- SetVar : VariableName:NewValue
- Note: The 'NewValue' can contain dynamic values (e.g. Placeholders for variables in shape data values | DataMiner Docs, such as a link to other sessions variables (e.g. [cardvar:VariableName]) or parameters (e.g. [param:DmaID/ElementID,ParameterID,TableRow])
- SetVarOptions : Control=Shape
- From DataMiner 9.0.5 onwards, by default the SetVar shape is shown as a basic button shape, even if a custom shape is configured in Visio. To revert to the legacy behavior and show the custom shape, add the following option in the SetVarOptions.
As for your second question, this is more difficult to answer as very likely we'll have to dig deeper to explain the full context (e.g. Do you need dynamic shapes based on all rows of your table). I can answer the core of the question though. There would be two possible ways, either you use the following: Linking a shape to an element parameter | DataMiner Docs, which can use Dynamic table filter syntax | DataMiner Docs (FK=) and also Basic conditional shape manipulation actions | DataMiner Docs to have the correct evaluation. A second approach would be to use Extended conditional shape manipulation actions | DataMiner Docs. Both of them will likely also use Placeholders for variables in shape data values | DataMiner Docs. So as you can see quite complex, knowing you're rather new to Visio. Feel free to get in touch with your technical contact to get more details.
Hope this helps you a little further!
Kind Regards,
Jarno
Thanks for your answer Jarno, I think perhaps you mis-understood my first question though; it was asking how to set a variable with no input from the user, but the page you linked to seems to exclusively show how to set a variable from a users’s input.
What I’m looking to do is compare two tables and set a variable based on that comparison – so then all the shapes can just reference my variable and not have to have the same comparison in each shape.
As for comparing, I think I can do that OK, it’s just about how to set a variable on load (and upon change) as it were.
Hi James, indeed my example needs user input. Could the following be something you could use: https://docs.dataminer.services/user-guide/Basic_Functionality/Visio/session_variables/Configuring_a_page_to_update_a_session_variable_when_another_session_variable_changes.html ?
This will execute when you open the page and you can then use the ‘new’ session variable everywhere else in your Visio.
Hello Jarno, is there any other way to set a variable without user input?
I need a way to:
Set a variable from inside a child group
Compare the child object to a higher level parent object (not the parent of this child)
If they match then set a variable with the ID of the match
Have higher level shapes show/hide based on this logic
This comparison needs to be re-evaluated when the tables of the parent of child change, and on load of the page.
Is that possible?
The confusion possibly exists because we typically call this (extended) conditions. It is hard to evaluate your request without seeing your Visio or knowing the full context.
I’d say, if you are using dynamic shape generation (e.g. a shape per row in a table), then it won’t work exactely how you want. I think this will only work the other way arround, i.e. use the parent information inside the child group.
If you have fixed identifiers to identify the child, you can use the same information in one of your parent shapes to make up the condition.
If this is still not clear to you, I would suggest to reach out to your technical contact or Skyline Techsupport.
Just to add some detail here, as I can only check which of the foreign table rows are the active input on the deepest table (the foreign table) I need to do the comparison there between the tables and then flag up a page variable (with the root table index as part of it’s name) that says if input 1 or 2 is active, from that I then need to set several shape’s fill to enable and some shape’s visibility to enable, to indicate this to the user.