Share feedback, ideas and get community help

Updated 6 months ago

How can generate a random number variable from 0.1 - 9.9?

At a glance

The post asks if it is possible to execute JavaScript in the "Set Variable" logic. The comments indicate that this is possible, and one community member provides an example of generating a random number between 11.3 and 12.5 using JavaScript. While there is no explicitly marked answer, the comments collectively suggest that the answer to the original question is "Yes".

Useful resources
Can I execute javascript in the set variable logic? Like:

const randomValue = Math.random() * (9.9 - 0.1) + 0.1;
console.log(randomValue);
B
d
3 comments
Sorted. In case this is useful for someone else. Here's the random number generator between 11.3 and 12.5


function getRandomNumber() {
return new Promise((resolve) => {
const min = 11.3;
const max = 12.5;
const randomNumber = Math.random() * (max - min) + min;
resolve(randomNumber.toFixed(1)); // Rounded to one decimal place
});
}
const wait = await getRandomNumber();
return wait;
Add a reply
Sign up and join the conversation on Discord