I’m trying to initialize a global variable in case the variable doesn’t exist yet, but for some reason Kantu fails to evaluate the Javascript and returns an error.
I’m running a Macro that opens a list of websites. Each website has a dedicated sub-macro that gets invoked by the main macro to collect data from that site. Sometimes one of these site fails for whatever reason… In which case, I invoke the main Macro once again to process everything once again.
But unfortunately, currently the Macro is processing every website, including the ones that were processed successfully. Instead, I’d like to be able to set a flag - a global variable (something like isCompleted) for each site that failed, and only process those.
Technically, global variables should be able to work because they retain values after the macro stops. But it’s not working at the moment because it throws an error when I check for the existence of the global variable.
@rafael777 But the macro snippet I posted allows exactly this, or? It checks for the existence of a global variable, and if it is not defined, it defines it. It might not be the most elegant solution, but it should work for your use case. But if not, please tell me why not.