How to change a variable value in Javascript?

I’m trying to use pure Javascript to change a boolean variable’s value:

variables[/* myVar */'fd25e204-0283-4ea7-a4e1-8b3ad10a6cca'] = false;

This doesn’t work. What’s the correct way to change a variable value in Javascript?

Can you post the context of where you’re trying to use this?

@luka I have an audio element on my page, and a JS script that returns “true” if the audio playback is >= 95%. Instead of just returning “true”, I’d like to change the variable value to “true”—that is, directly in the JS script.

the easiest way to interact with weweb stuff from an external script is to trigger a global workflow with wwLib.executeWorkflow(id,parameters) so that you can pass values and use them in the nocode workflow

1 Like

FYI a quick rundown of how to do that by @dorilama is here: Editing values from a custom JavaScript Embed