Ready to witness the enchanting blend of JavaScript magic and no-code/low-code simplicity with ZeroWork? Join me for an unforgettable journey into the realm of automation!
Video Tutorial
This video is about using JavaScript in conjunction with ZeroWork Creator App to automate the generation of random numbers and insert them into a website. The taskbot follows steps such as opening a specific website, generating a random number within a specified range, storing the number in a variable, and finally inserting it into a text input field on the website.
TaskBot Workflow
Generating random numbers in JavaScript.
-vY6n7WfR.png)
JavaScript code snippet:
// Generate a random number between a specific range, for example, between 5 and 100
let min = 5;
let max = 100;
let randomNumberBetween5And100 = Math.floor(Math.random() * (max - min + 1)) + min;
// console.log(randomNumberBetween5And100);
// Store the generated random number in a variable named 'RandomNumber'
await setRef({ ref_id: 26588, name: 'randomNumber', value: randomNumberBetween5And100.toString() });
NOTE
Before starting TaskBot for the first time, make sure you are referencing the correct variable ID:
Click on the "Write JavaScript" building block and replace the ref_id with the ID number of your variable.
The JavaScript code line that needs to be modified is: await setRef({ ref_id: 26588 // change this ID number
Variable IDs can be found in the variables dialog.
Links
- Link to the TaskBot (access a full copy of my TaskBot): https://go.ebizhero.com/commTaskBotGenerateRandomNo
- ZeroWork Creator App - Web Scraping & Browser Automation 🌐: https://go.ebizhero.com/zerowork