Input variables are not defined inside the custom javascript function

I have created 2 theme variables, then created a custom javascript function with 2 inputs.
Then I assigned the 2 theme variables to the 2 function inputs.
When the function is called, the 2 inputs are not defined, and the following error is displayed in the debugger console.

TypeError: Cannot read property ‘$variableName’ of undefined

How can I fix this error?
or how to pass theme variables to a custom javascript node?

Thank you!

1 Like


Unfortunately there’s a bug in binding theme variables to javascript functions :confused: it’s on our to-fix list and hopefully will be resolved soon, sorry for the inconvenience! In the meantime I suggest you simply manually input the values to the javascript function, if you want to progress with your development before this gets fixed.

1 Like

Thank you!
I have added the values manually and it works.
Should it work if I replaced the theme variables with app variables?

It should work to use app variables instead of theme variables :slightly_smiling_face: But at the moment it seems like theme variables don’t work in any flow functions so you can’t use Set app variable to copy the theme variable into an app variable and use that in the javascript.