What you might find better, as i have recently discovered, is that you if you want to change the value of an app connect variable (like in your example) you can use dmx.parse. Like this:
dmx.parse('var_1.setValue("xyz")')
(or you can have the value being any variable etc from your JS code)
With dmx.app.set, it does create a variable with that value, but its not selectable in the UI in app connect. But if you use dmx.parse and use the .setValue("value")'
you can actually change the value of an app connect variable.
I’d try that.