How to sum the values of a multivalue token in Simple XML?
Let's say you have a mv token named test1 with values of: 1,2,3
How to achieve something like:
<eval token="test2">sum($test1$)</eval>
Thanks!
One way might be to use relative_time which will interpret strings
<eval token="test2">if(mvcount($test1$)>1,relative_time(0,"@s+".mvjoin($test1$,"s+")."s"),$test1$)</eval>
Be aware that is $test1$ is from something like a multiselect dropdown, you may need to use $form.test1$ to get the multivalue version of the field rather than the concatenated version.
What a trick! Well done....
One way might be to use relative_time which will interpret strings
<eval token="test2">if(mvcount($test1$)>1,relative_time(0,"@s+".mvjoin($test1$,"s+")."s"),$test1$)</eval>
Be aware that is $test1$ is from something like a multiselect dropdown, you may need to use $form.test1$ to get the multivalue version of the field rather than the concatenated version.