In edit mode I see “true” for the 2nd variable but in preview I see 2x false. Isn’t it supposed to show ‘true’ the 2nd time since the variable has been created outside the ic-statement? It is like the value is not being assigned.
I can simulate your issue, as if I reproduce your code, your boolean value will have the value false (as your first var is created no matter what).
Your second var testVar however, will only be created in input-mode however, which is the issue you’re facing
but you have to watch out with coding like this. I’d advise you to always create vars outside IC-tags. Yes, that means an extra line of coding in this case, as you cannot use the assign attribute as that would mean the creation of the variable (that has to work, no matter IC or NIC) is only done in input-mode:
Thanks for your quick reply! Your code is working but I’m not sure what the difference is with mine?
I see you are using the value of the global variable, in the local variable instead of “assign” but the outcome is the same, no? Isn’t it supposed to work how I did it?
No, because your assign statement is done within IC-tags, meaning the var testVar will be created only in input-mode.
If you then export the template (export mode), that variable isn’t created anymore.
will only work in IC-mode as your assign-statement is done in IC-mode. Hence, you cannot really use that assign within the input-statement IF that input-tag is also between IC-tags.
Hope that clarifies it; if not, don’t shy away to ask