• Don't use an expression for the default value.

    That expression will be evaluated every time the variable is referenced.

    So what is happening is that your Expression task is setting the variable value, and but when you later reference that variable, the expression is automatically evaluated setting the value back to your default value.

    You have two options:

    Remove the expression on the variable itself, and set the value at run-time with the expression task.

    Use the expression to set the value based on your newvalue variable.