Adding "Math.floor(Math.random() * 6000)" to wait field using javascript before the </body>

I’d like one of my interactions to have a random ‘wait’ time before executing. I’m having trouble figuring out how to target it with javascript. I’ve named the step “random-wait”… if that helps… Any ideas? @waldo?

What you describe is not possible. You cannot mix custom code and interactions.

You can convert the entire interaction to pure JavaScript though.

So, my knowledge of javascript is still pretty limited, so forgive me for pushing, but this just looks to me like json, right?

I just want to replace the circled value with “Math.floor(Math.random() * 6000)”. That seems like a typical javascript thing to do to me, I just don’t know how to target the value… what makes it so this can’t be done? Limitations of javascript or limitations that Webflow has built in to their webflow.js file?

That is because there is no Webflow JavaScript API for changing interactions. You can set a value in the interactions panel, but it cannot be random.

1 Like

:confused: … thanks :smile: