Looping through each column in CSV file (e.g. COL1, COL2... COL6)

Hello,

I have a CSV file with URLs in the columns. I am using UI.Vision Kantu to open these URLs. The issue I am having is that I am hard coding each column which will become problematic as more URLs are added. My question is, are there ways to loop through each column in a CSV rather than writing each column in one long line of code? I have included my code below:

{
  "Name": "Edge_Chromium_Apps",
  "CreationDate": "2019-12-5",
  "Commands": [
    {
      "Command": "csvRead",
      "Target": "TestData.csv",
      "Value": ""
    },
    {
      "Command": "executeScript",
      "Target": "return 0;",
      "Value": "counter"
    },
    {
      "Command": "storeEval",
      "Target": "new Array ('${!COL1}', '${!COL2}', '${!COL3}', '${!COL4}', '${!COL5}', '$!COL6}')",
      "Value": "websites"
    },
    {
      "Command": "while_v2",
      "Target": "${counter} < ${!csvReadMaxRow}",
      "Value": "counter"
    },
    {
      "Command": "storeEval",
      "Target": "storedVars['websites'][${counter}]",
      "Value": "site"
    },
    {
      "Command": "open",
      "Target": "${site}",
      "Value": ""
    },
    {
      "Command": "executeScript",
      "Target": "return ${counter} + 1;",
      "Value": "counter"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }
  ]
}

Hi

Rewrite your code like this example and with loop you can open unilimited url from a csv

Hi,

I am trying to get it to loop through each one. I tried to reference it as {!COL{counter}} (e.g. COL1 if counter was 1) but it then interprets it as a string and not an internal variable.

Your code is wrong you must use corrct syntax in macro code

https://ui.vision/rpa/docs/selenium-ide/csvread

Convert csv in a better format to solve the problem