Base64 encode/decode JS in automation - atob/btoa #13148
Unanswered
andyburgessmd
asked this question in
Help
Replies: 1 comment 6 replies
-
Hey @andyburgessmd, TLDR of the below: atob() won't work in backend development environments. The reason for this is due to automations being a backend piece of code. The atob() is commonly associated with frontend development, particularly in web browsers, where it is used to decode data that has been encoded using the btoa() function. However, it's important to note that the atob() and btoa() functions are part of the Web API and are not native to Node.js or other backend JavaScript environments. We have decode helper functions that you can use. var decoded = helpers.decodeURI("aGVsbG8gd29ybGQ=")
return decoded; |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use the atob JS function in automation to decode a base64 encoded string but the output is always 'Error while executing JS'.
The JS works when used in a page but not in automation.
For now I am just trying to get a very simple 'hello world' to decode with
in a backend log but this returns the error above.
Does anyone know if atob/btoa are supported in automation?
Beta Was this translation helpful? Give feedback.
All reactions