What exactly goes wrong? The DemoStoreEval macro contains a test case on how to use arrays and storedVars, here is the relevant part of this macro (starts at source line 154) :
{
"Command": "storeEval",
"Target": "new Array ('cat','dog','fish','dog','🐟','frog','dog','horse','??elephant')",
"Value": "names"
},
{
"Command": "storeEval",
"Target": "storedVars['names'].length",
"Value": "length"
},
{
"Command": "echo",
"Target": "array length = ${length}",
"Value": ""
},
{
"Command": "storeEval",
"Target": "Math.floor(Math.random()*storedVars['length'])",
"Value": "num"
},
{
"Command": "echo",
"Target": "num=${num}",
"Value": ""
},
{
"Command": "echo",
"Target": "The next command picks the random item",
"Value": ""
},
{
"Command": "storeEval",
"Target": "storedVars['names'][${num}]",
"Value": "myrandomname"
},
{
"Command": "store",
"Target": "Today is ${mydate}, and we draw a ${myrandomname}",
"Value": "output"
},