Dear Dojo Community,
In a Visio being designed by our team, we aim to create an execution command that sets the value to the current value incremented by 1.
To pinpoint the issue, we hardcoded the reference to the element and parameter explicitly. The Shape Data behind the increment button is as follows:
.
When the shape is clicked, the parameter is set to 1 instead of the sum of the existing value and 1.
To further troubleshoot, we simplified the problem by testing if the existing value is correctly read. Here are the test results:
The implementation and type of parameter 2602, along with its corresponding write parameter 2652, appear to be relevant to this problem. Therefore, we have included the implementations below.
We suspect that the unit 'frames' might be the cause of the issue, as the parsing of the sum syntax seems to struggle with this unit.
Is our suspicion correct? If so, is there a way to overcome this?
Kind regards,
Joachim
Your assumption is correct. The sum placeholder takes in string values and parses them to either a number or a datetime/timespan. If that doesn't work, the sum doesn't work.
To resolve this, you could wrap the param placeholders in a regexreplace placeholder to cut off the units. I realize it's not the ideal, but I believe it's the best workaround we currently have.
With the suggestion provided by Toon, we could use the RegexReplace to solve the problem: The eventual Shape Data needed is as follows:
More details on RegexReplace can be found in this section in our docs.
Thank you, Toon, for the prompt confirmation and the effective workaround. I will mark your response as the accepted correct answer and provide an additional answer encompassing the complete solution. This will serve as an illustrative example to help other community members encountering a similar problem.