Hi all,
I want to create a macro that achieves the following:
- Read {COL1} of a csv (i.e. “8”)
- Perform a loop that number of times, so in this case, I want the macro to loop 8 times
This is what I have so far. Everything works except it only performs it once and doesn’t loop?
Code so far:
{
"Name": "incrementing-loop-read-csv ",
"CreationDate": "2020-5-23",
"Commands": [
{
"Command": "store",
"Target": "0",
"Value": "myCounter"
},
{
"Command": "csvRead",
"Target": "spreadsheetcounter.csv",
"Value": ""
},
{
"Command": "store",
"Target": "Number ${!COL1}",
"Value": "numCSV"
},
{
"Command": "echo",
"Target": "Now starting, current count is ${myCounter}",
"Value": "green"
},
{
"Command": "echo",
"Target": "Also, our value pulled from the CSV is: ${numCSV}",
"Value": "blue"
},
{
"Command": "label",
"Target": "restartCounter",
"Value": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return Number (${myCounter})+1",
"Value": "myCounter"
},
{
"Command": "echo",
"Target": "Continuing, new count is ${myCounter}",
"Value": "green"
},
{
"Command": "gotoIf_v2",
"Target": "${myCounter} < ${numCSV}",
"Value": "restartCounter"
}
]
}