Preventing variable from evaluating the expression

Hi,
We need to have a variable that evaluates/run the expression only when a certain condition is met, otherwise leave the older value without change. Is this possible?

Thanks.

Dear @alsaleem ,
Please take a look at this article, Other Useful Operators section.

The answer is probably ‘no’.

This is because calculated variables in Survey Solutions don’t have ‘memory’. They are recalculated (when needed), as opposed to a container storing some value, and some code that uses and refreshes the value periodically or under some conditions.

That said, one of the following is also likely:
A) you don’t need it to do your survey in Survey Solutions, or
B) you can rely on the default value supplied, e.g. in a hidden question, and some expression in the calculated variable using it, and something else in your questionnaire.

Best, Sergiy

Thanks @vfedoseev / @sergiy,

@vfedoseev. I checked the article. However, the final result is to pass a value.

@sergiy
I get it “variables do not have memory”, this is clear.

I can think of a work around to disable/hide the question on not meeting the condition.

Does interviewer allow to pass the question answer if it is disabled after completing the interview on synchronization? How to acheive this if it requires some additional steps?

Thanks.