setValue() should save immediately during queries

I talked about this in a call earlier but it would be a lot easier and more intuitive if setValue() worked immediately instead of at the end.
I have cases where a JS query sets some values and uses those values later.
Simple example:
text1.setValue(“TestA”);
text2.setValue(text1.value);
text1.setValue(“TestB”);
The first time I run it, text2 stays as the default text because text1 hasn’t been set yet. The second time I run it, it’s set text1 to “TestB” so it sets text2 to “TestB”.

hmm, it’s actually really hard for us to do that properly, since setValue is actually asynchronous. maybe one thing we can do is get this to work better:
(async function() { await text1.setValue("TestA") await text2.setValue(text1.value); await text1.setValue("TestB"); })()

^this one also doesn’t work right now, because text1.value (and the values of all the retool vars in general) are fixed throughout the whole script. but we can look into fixing it!

would that be good enough @phillip?

Yeah, I think that would work. It’s not usually an issue but not knowing what to expect it became an issue with the way I approached my first apps.

yeah that totally makes sense! I’ll keep you updated as we work on this