Hello everyone,
I created a Visio file for a resource in my DMA and initialized a variable using this:
When I display this variable value in another shape, it correctly displays my Resource GUID.
But when I try to re-use this variable content in another placeholder, it fails. As a workaround, if I type the GUID directly in the shape, it works fine.
Here's my Visio file:
Here's the result:
I was expecting both approaches to give me the same result. Does anyone knows why the variable approach doesn't work?
(I'm using DataMiner 10.1.2.0-9866)
It seems like several concepts got a bit mixed up here:
- The [Guid] placeholder, which is currently only supported in the InitVar shape data, generates a new unique guid. This guid is by no means related to anything on your Visual Overview and is totally random. It is meant as a random seed for your local session.
- The set of the session variable during the InitVar will only occur when that session variable has no value in it's current context. In your example, I believe the ThisGuid session variable already has been set to the guid of the resource. Since this is a global session variable, this value is never cleared and using it in an InitVar will no longer do anything. Instead, you can try using a CardVariable or PageVariable which both have a new context for a new card.
Correct 🙂
Hi Bruno,
I might be wrong, but from your screenshot, the static GUID you are using is not the same GUID available in the session variable?
Hi Jarno, you’re correct. I only checked the first digits and immediately assumed that the GUIDs were the same. Thanks for the heads-up.
Hi Bruno,
I've had problems in the past using placeholders within an 'InitVar' shape data. It might not actually be fully supported... Would be good if someone from the dev squads could confirm.
In any case, an alternative might be to use an 'Execute' shape data instead.
More info here: https://help.dataminer.services/dataminer/#t=DataMinerUserGuide%2Fpart_2%2Fvisio%2FConfiguring_a_page_to_update_a_session_variable_when_another_session_variable_changes.htm
Syntax is the following:
SET|X|Y|Z|SetTrigger=ValueChanged
'X' and 'Y' parts should be filled in with the scope of the variable (eg 'CardVar') and the name of the variable respectively.
For 'Z', you could then use the guid placeholder, as this represents the value the session variable will take on.
Don't forget to also add an 'Options' shape data with value 'ExecuteSetsonInit'.
Please let us know if this works.
The rule of thumb when using placeholder in the InitVar shape data is that your placeholder can’t resolve asynchronous. The InitVar operation is executed before page load but it will not block the page from loading. This means that placeholders like [param:] or [property:], which fetch data from the server, will be seen as empty.
Thanks for the clarification Sebastiaan.
So the [Guid] placeholder is something else, not related to the Resource GUID.