forEach not recognize my array with error: "target must be an array"

The for “foreach” command does not recognize my array.

I copied the example as shown forEach Flow Control - Selenium IDE Commands Tutorial and get the error “target must be an array” when it hits the foreach command.
In fact I’m able to access able to access the 2nd element of the array variable directly but the forEach command does not recognize my array variable as an array.
I’m on version 5.5.7

I think there is a bug.

Here is my code:

{
  "Name": "Test 3",
  "CreationDate": "2020-4-7",
  "Commands": [
    {
      "Command": "executeScript_Sandbox",
      "Target": "return [\"Hello\",\"Bonjour\",\"Hi\"];",
      "Value": "A1"
    },
    {
      "Command": "echo",
      "Target": "${A1[2]}",
      "Value": ""
    }, 

    {
      "Command": "forEach",
      "Target": "${A1}",
      "Value": "greeting"
    },
    {
      "Command": "echo",
      "Target": "${greeting} and have a nice day!",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }
  ]
}

I found the issue:

wrong: forEach | ${A1} | greeting

correct: forEach | A1 | greeting

The reason for this is that forEach does not take the value of the variable/array as input, but the array itself => no ${…}

Having said this, I noticed that this was wrong on our for each docs page => fixed now! Thanks for reporting this issue!

this works:

{
  "Name": "foreach",
  "CreationDate": "2020-4-8",
  "Commands": [
    {
      "Command": "executeScript_Sandbox",
      "Target": "return [\"Hello\",\"Bonjour\",\"Hi\"];",
      "Value": "A1"
    },
    {
      "Command": "echo",
      "Target": "${A1[2]}",
      "Value": ""
    },
    {
      "Command": "forEach",
      "Target": "A1",
      "Value": "greeting"
    },
    {
      "Command": "echo",
      "Target": "${greeting} and have a nice day!",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }
  ]
}