rival-black•2y ago
Using variable defined in JavaScript function
I have the following function, which I use in Javascript step. At the end of the function the variables tageHauptsaison, tageNebensaison and tageAussersaison are defined. In the next step I want to use a talk step to show the variables. I defined the variables {tageHauptsaison}, {tageNebensaison} and {tageAussersaison} and used them in the talk step. If I run the bot these varaibles always have the value 0. If i run the JavaScript in the Browser its working properly.



3 Replies
Do you have those variables defined within VF?
rival-blackOP•2y ago
Yes i have them defined in VF. If i type for example "t" into the code VF detects the variable and opens a drop down menu.


Do not declare existing global variables in your code.
Remove the
const
for the Tage... variables.
Remove the console.log() as well as it's not supported in the Javascript Step.
Good practice when debuging is to enable the debug mode in the test tool settings as you will be able to get your code error(s).