Loop with CSV only working with one single value?

I am new to UI Vision and am trying to test looping through a CSV to replace a value on each iteration. I am specifically using the Loop runner built into the UI, rather than loop commands.

My CSV is a single column file with five rows. Each time the loop executes, it keeps filling in with the value in the last row, rather than iterating through each row on each loop.

I’m guessing I’m missing something in terms of iterating through the values. Is/are there some additional commands I need to call?

{
  "Name": "CSV Loop (In Progress)",
  "CreationDate": "2024-7-22",
  "Commands": [
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "csvRead",
      "Target": "uivision csv loop test.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // ${!csvReadMaxRow}",
      "Value": "!csvReadLineNumber",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "csvRead // uivision csv loop test.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"listemails_filter\"]/label/input",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"listemails_filter\"]/label/input",
        "xpath=//label/input",
        "css=#listemails_filter > label > input"
      ],
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"listemails_filter\"]/label/input",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"listemails_filter\"]/label/input",
        "xpath=//label/input",
        "css=#listemails_filter > label > input"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"listemails\"]/tbody/tr/td/label/input",
      "Value": "${!COL1}",
      "Targets": [
        "xpath=//*[@id=\"listemails\"]/tbody/tr/td/label/input",
        "xpath=//input[@type='checkbox']",
        "xpath=//td/label/input",
        "css=#listemails > tbody > tr > td:nth-child(1) > label > input"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"listemails_filter\"]/label/input",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_CTRL+KEY_A}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_DELETE}",
      "Value": "",
      "Description": ""
    }
  ]
}

In general, we recommend to use the loop commands (e. g. TIMES, WHILE…END, DO…REPEATIF) instead of the “Loop” button.

This will also solve your problem: Because with the LOOP button, each loop is a new macro run and the state of the previous run is cleared. That is why it starts always again in the first line.

If you add the loop to the macro, you avoid this. See also the “DemoCsvReadWithWhile” macro that gets installed with the browser extension.

Understood! Thank you for your assistance!