I need to shuffle the order of a block of multiple choice buttons. I trying this:
Block to setVariable
Block with shuffle script
Block to show the options.
function shuffle(array) {
array.sort(() => Math.random() - 0.5);
}
let x = {{options}};
shuffle({x);
setVariable({{options}}, x);
does not work![No description](https://cdn.answeroverflow.com/1257689042422857788/typebot.png)
2 Replies
try using this script :
uncheck "Execute on client?" because the
setVariable
function is only available in script executed on the server![No description](https://cdn.answeroverflow.com/1257745711093776494/Screenshot_2024-07-02_at_10.40.55_PM.png)
thanks. It works perfectly