Code Snippets
The Write Javascript step within Axiom.ai allows you to enhance Axiom.ai's features and provide additional customisation options. We have provided code snippets that have been tried and tested within Axiom.ai and users have found helpful - many of these have some from customer requests!
We have two buckets of code snippets to choose from. Both sets of code snippets are based in JavaScript, however, the Puppeteer snippets rely on a Node.js library that is built into Axiom.ai.
Jump to:
# Running code in app
The "Run in app" option within the "Write Javascript" step can be used to run code in the context of the desktop application, rather than the context of the browser. If you are running your automation locally, you will need to have the desktop application installed and active. There are some benefits to using it with your other scripts, such as:
- Ensuring your code does not interfere with the site's code - for example, triggering event listeners, conflicting function or variable names.
- Accessing the Puppeteer library (required to use the "Run in app" option).
The downside of running code in the desktop application is the inability to access elements, functions or variables from the page that your automation is running on. You will not have the ability to see the console output from code within the "Write Javascript" step while using this option.
Can't find what you're looking for or want to share something you've worked on? Let us know in our community (opens new window)