I am attempting to change a variable I created in a block using JS code. Unfortunately, the changes made in the code do not reflect in the variable after running the program. The code has been verified in VS Code to run properly and to the spec as needed.
Additionally, the global variable declaration and subsequent code is very similar to behavior in another bot that DOES work.
Finally, by adding a bit to the code that throws an error if the variable is properly updated within the context of the code, I am able to verify that until the bot exits the JS Code block, the variable is properly updated, and then it reverts to the initial state as if it were a local variable deleted when it goes out of scope.
Edit: This topic is resolved, turns out throwing an error causes the platform to dump any changes to global variables made in the JS block. This should be described in the documentation for the “Execute JS code” function