Help, with variable read

Good morning, I’ve been trying to load a link where the number is a variable, but this variable would have to be loop type.

“Command”: “store”,
“Target”: “10596465;10596461;10595940”, – THIS IS THE POINT I DON’T UNDERSTAND
“Value”: “myvar”,
“Description”: “”

http://10.162.102.187:8080/jbpm-console/app/procins.jsf?id=${myvar}&view=token

myvar can only 1 value? I would like to put multiple values ​​, like loop

{
“Name”: “fim_processo”,
“CreationDate”: “2021-12-30”,
“Commands”: [
{
“Command”: “store”,
“Target”: “10596465;10596461;10595940”, – THIS IS THE POINT I DON’T UNDERSTAND
“Value”: “myvar”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “http://10.162.102.187:8080/jbpm-console/app/procins.jsf?id=${myvar}&view=token”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “linkText=End@POS=4”,
“Value”: “”,
“Targets”: [
“linkText=End@POS=2”,
“xpath=//*[@id=“j_id253:0:j_id275”]/a”,
“xpath=//a[@onclick=“var a=function(){return confirm(‘Are you sure you want to end this token?’);};var b=function(){if(typeof jsfcljs == ‘function’){jsfcljs(document.getElementById(‘j_id253:0:j_id275’),{‘j_id253:0:j_id275:j_id276’:‘j_id253:0:j_id275:j_id276’,‘xtoken_id’:‘10596124’},’’);}return false};return (a()==false) ? false : b();”]”,
“xpath=//td[8]/form/a”,
“css=#j_id253:0:j_id275 > a”
],
“Description”: “”
}
]

Tks for help Guys

You can use

“Command”: “store”,
“Target”: “10596465;10596461;10595940”
“Value”: “myvar${!LOOP}”,
“Description”: “”

To have unlimited var it will be myvar1, myvar2 or you can use a custom name

Hello, the solution actually takes var1, var2 and etc , but doesn’t get the value of var.
:frowning:

/jbpm-console/app/procins.jsf?id=myvar2&view=token

  "Command": "store",
  "Target": "9937083,10631685",
  "Value": "myvar",
  "Description": ""
},
{
  "Command": "open",
  "Target": "http://10.162.102.187:8080/jbpm-console/app/procins.jsf?id=myvar${!LOOP}&view=token",
  "Value": "",
  "Description": ""
},

Your macro code is wrong edit in this mode


{
  "Command": "open",
  "Target": "http://10.162.102.187:8080/jbpm-console/app/procins.jsf?id=${myvar}${!LOOP}&view=token",
  "Value": "",
  "Description": ""
},

You setted in wrong way myvar in url

{
“Command”: “executeScript_Sandbox”,
“Target”: “var arr=[“10596465”,“10596461”,“10595940”];\nreturn arr[Number(${!loop})-1];”,
“Value”: “myvar”,
“Description”: “”
},
{
“Command”: “prompt”,
“Target”: “${myvar}”,
“Value”: “”,
“Description”: “”
}

var arr=[“10596465”,“10596461”,“10595940”];
return arr[Number(${!loop})-1];

Thanks a lot for the help. It’s running. below the complete script to help the next ones.

{
“Name”: “fim_processo”,
“CreationDate”: “2022-2-10”,
“Commands”: [
{
“Command”: “executeScript_Sandbox”,
“Target”: “var arr=[“10074189”,“10074284”,“10130411”,“10274439”,“10285611”,“9389929”,“8967747”,“9698443”,“9327095”,“9334259”,“9705652”,“9379555”,“9385580”,“9400316”,“9401794”,“9712214”,“9699241”,“9715686”,“10658045”,“9051392”,“9318285”];\nreturn arr[Number(${!loop})-1];”,
“Value”: “myvar”,
“Description”: “”
},
{
“Command”: “comment”,
“Target”: “prompt // ${myvar}”,
“Value”: “myvar”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “jbpm-console/app/procins.jsf?id=${myvar}&view=token”,
“Value”: “”,
“Description”: “”
},
{