Variable display bug

Consider the following automation I created:

{
  "Name": "bug",
  "CreationDate": "2026-9-15",
  "Commands": [
    {
      "Command": "executeScript",
      "Target": "var arr = new Array (\"test array\", \"random initial values\", \"blah blah\", \"I am tired\");\nreturn arr;",
      "Value": "arr",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "ind",
      "Description": ""
    },
    {
      "Command": "do",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${ind}) + 1;",
      "Value": "ind",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${ind}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript",
      "Target": "var hold = new Array (\"Unique value ${ind}\", \"Another Unique value ${ind}\", \"Last Unique value ${ind}\");\nvar exi = new Array (${arr});\nvar cre = hold.concat(exi);\nreturn cre;",
      "Value": "arr",
      "Description": ""
    },
    {
      "Command": "repeatIf",
      "Target": "${ind} < 10",
      "Value": "",
      "Description": ""
    }
  ]
}

This is not the original automation I wrote, but can still be used to recreate the problem. The purpose of the initial automation was to keep track obtain all “innerText” properties of elements that were of a particular class, across multiple different web pages. This was done by creating an array with the first page’s values (we will call this array 1), and then creating a loop that would find the values for the next page, import array 1, concatenate the two arrays together then overwrite the value stored in array 1 with the concatenated array, and repeat for all the rest of the pages. The above automation is the same, but the info scraped from the web are hard coded values. If you run the above automation, take a look at the “arr” variable in the variables tab, and you will see something like this:

See the problem? It would seem that the tool is not correctly concatenating the array, as each itteration is added as a new array within the overal array, but without the closing bracket, which is just added at the end. Its kind of weird. I don’t think that it is displaying a valid array at all.

Thanks for the detailed repro. The array is being built exactly as the script asks, so this is a JavaScript detail rather than a display problem.

In executeScript, ${arr} is inserted as a JSON array literal, and new Array([…]) with a single array argument creates a one-element array that contains your whole list. concat then appends that as a nested element, and every loop pass adds one more level, which is why all the closing brackets pile up at the end. The Variables tab shows the real (nested) value.

Use var exi = ${arr}; instead of new Array(${arr}) and the concatenation stays flat.

Either of these gives a flat list:

var exi = ${arr};
var cre = hold.concat(exi);