Can't change input value from runjavascript action

Hi!

I'm very new to outsystems and this is my first time using this action. I need to change the value of an hidden input in a page, but the value only changes inside the javascript code and it seems to "forget" it afterwards.

I have an input set up like this:


I have a button that's executing the following logic:

When I attempt to run it, I can see in the browser console the "Hey 3" value, so the code is working as intended. But when I debug the expression I get this:

So it seems that the input value only changes within the script and then resets. Why is this happening?

Thanks in advance.

Best regards,

Tomás

I'm having this input too sometimes, if I remember correctly it has to do with the fact that the variable isn't used anywhere later in your code, so at that point the server just forgets about it's value for efficiency sake.

You can try doing some feedback message with the value or something else to see if  the value is now kept.

You might also want to trigger an onchange on your input, outsystems doesn't recognize a change if it doesn't trigger a change event.