Skip to content

JavaScript Execution

RTILA X provides two ways to execute JavaScript.

Runs JavaScript in the browser page context. The script has access to the DOM and page elements.

Parameter Description
script JavaScript code to execute
output_variable Variable to store the return value

Example:

script: return document.title;
output_variable: page_title

Example — Click an element:

script: document.querySelector('.submit-button').click();

Example — Get all links:

script: return Array.from(document.querySelectorAll('a')).map(a => a.href);
output_variable: all_links

Runs a Deno script on the server side. The script has full access to the file system, network, and RTILA APIs.

Parameter Description
script Deno script code

⚠️ Warning: run_script runs with full system access. Use with caution.

Example:

script: |
const data = await Deno.readTextFile("data.json");
const parsed = JSON.parse(data);
return parsed;

In execute_script, you can access runtime variables via the variables object:

script: return variables.price * 1.2;

In dataset transformations, the script transformation receives the current value as value:

code: return value.toUpperCase().replace("USD", "").trim();