Internal variable "!COL1" not supported

I am using a CSV file imported using the ‘import CSV’ function. My CSV file has column headers labelled COL1, COL2 etc… In my test target and pattern I have ${!COL1} , ${!COL2} etc…

However when running the test I immediately receive “error Internal variable “!COL1” not supported”

Initially I thought I received this because I am using Firefox however I use Chrome and this still occurs.

Any advice please

Can you please post a test macro here?

{
“Name”: “TEST CSV”,
“CreationDate”: “2019-1-21”,
“Commands”: [
{
“Command”: “open”,
“Target”: “http://medeformappde00.medway.gov.uk:8080/ufs_dev/ufsmain?formid=LE_BURNODOUR”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=CTID-346--A",
“Value”: “label=Air pollution (including dust/grit in the air)”
},
{
“Command”: “click”,
“Target”: "name=CTRL:145:
”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=CTID-514--A",
“Value”: “Chart Place”
},
{
“Command”: “click”,
“Target”: "name=CTRL:525:
”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=CTID-529--A",
“Value”: “label=CHART PLACE, PARKWOOD, GILLINGHAM”
},
{
“Command”: “click”,
“Target”: "name=CTRL:538:
”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “name=CTRL:145:",
“Value”: “”
},
{
“Command”: “click”,
“Target”: "name=CTRL:538:
”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=CTID-454--A",
“Value”: “label=Commercial/Business use”
},
{
“Command”: “type”,
“Target”: "id=CTID-348-
-A”,
“Value”: “Garden”
},
{
“Command”: “click”,
“Target”: “id=CTID-444--A-2",
“Value”: “”
},
{
“Command”: “click”,
“Target”: "id=CTID-450-
-A-2”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=CTID-452--A",
“Value”: “Air Pollution Commercial Business use No path”
},
{
“Command”: “type”,
“Target”: "id=CTID-355-
-A”,
“Value”: “Air Pollution Commercial Business use No path”
},
{
“Command”: “click”,
“Target”: “name=PAGE:N”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=CTID-259--A",
“Value”: “label=Mrs”
},
{
“Command”: “type”,
“Target”: "id=CTID-261-
-A”,
“Value”: “${!COL1}”
},
{
“Command”: “type”,
“Target”: “id=CTID-263--A",
“Value”: “${!COL2}”
},
{
“Command”: “click”,
“Target”: "name=CTRL:267:
”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=CTID-469--A-1",
“Value”: “”
},
{
“Command”: “type”,
“Target”: "id=CTID-474-
-A”,
“Value”: “1”
},
{
“Command”: “type”,
“Target”: “id=CTID-477--A",
“Value”: “Street”
},
{
“Command”: “type”,
“Target”: "id=CTID-480-
-A”,
“Value”: “Town”
},
{
“Command”: “type”,
“Target”: “id=CTID-482--A",
“Value”: “Sussex”
},
{
“Command”: “click”,
“Target”: "name=CTRL:499:
”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=CTID-268--A",
“Value”: “01634 333333”
},
{
“Command”: “type”,
“Target”: "id=CTID-272-
-A”,
“Value”: “lagandev.sentmail@medway.gov.uk
},
{
“Command”: “click”,
“Target”: “name=CTRL:549:",
“Value”: “”
},
{
“Command”: “click”,
“Target”: "name=CTRL:66:
”,
“Value”: “”
}
]
}

This is an internal eform.

the csvread command is missing

1 Like

My apologies!

Thank you

1 Like

Hi
Iam a beginner. I am unable make the CSV read demo work. Can any one correct the code so that i can build on it.

{
“Name”: “Sub_DemoCsvRead_FillForm”,
“CreationDate”: “2020-7-25”,
“Commands”: [
{
“Command”: “open”,
“Target”: “Sample Sign-Up Form”,
“Value”: “”
},
{
“Command”: “csvRead”,
“Target”: “readcsvtestdata.csv”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “name=entry.933434489”,
“Value”: “${!COL1}_${!csvReadLineNumber}”
},
{
“Command”: “type”,
“Target”: “name=entry.2004105717”,
“Value”: “${!COL2}”
},

{
“Command”: “type”,
“Target”: “name=entry.1382578664”,
“Value”: “${!COL3}”
},
{
“Command”: “clickAndWait”,
“Target”: “xpath=//*[@id="mG61Hd"]/div/div/div[3]/div[1]/div/div/span/span”,
“Value”: “”
}
]
}

Oh, im very sorry… but i recived the same error… [error] [Line 10] Internal variable “!COL2” not supported… but in COL2… the macro does not recognize the column separation of the csv and places all the data in the row in the first field of the form … very thanks for that…

… you see?

{
“Name”: “ToFill”,
“CreationDate”: “2020-9-6”,
“Commands”: [
{
“Command”: “csvRead”,
“Target”: “teste1.csv”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=EnderecoCEP”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=EnderecoCEP”,
“Value”: “{!COL1}" }, { "Command": "click", "Target": "id=EnderecoCEP", "Value": "" }, { "Command": "click", "Target": "id=Pesquisar", "Value": "" }, { "Command": "click", "Target": "id=EnderecoVia", "Value": "" }, { "Command": "select", "Target": "id=EnderecoVia", "Value": "{!COL2}”
},

Fix your code have errors

variable need to add in front $ example: ${!COL1} or ${!COL3}

In your macro code you write in wrong sintax the variables.

Oh, I’m so sorry. I do not know what happened. My code is correct there. I don’t know why it came without the $. I’ll copy again … I appreciate your help.

It happens that it inserts all the data of the first line of the csv in the first field of the form. Then, only afterwards, it presents the following error:
[error] Line 7: Internal variable “! COL2” not supported
But it is obvious that it must present this error. It didn’t recognize the second column before and put all the data in the first field on the form. But why did it do that?

and the code is below
…,

{
  "Command": "csvRead",
  "Target": "teste1.csv",
  "Value": ""
},

{
  "Command": "click",
  "Target": "id=EndC",
  "Value": ""
},
{
  "Command": "type",
  "Target": "id=EndC",
  "Value": "${!COL1}"
},
{
  "Command": "click",
  "Target": "id=EndC",
  "Value": ""
},
{
  "Command": "click",
  "Target": "id=Search",
  "Value": ""
},

{
  "Command": "click",
  "Target": "id=EndV",
  "Value": ""
},
{
  "Command": "select",
  "Target": "id=EndV",
  "Value": "${!COL2}"
},
{
  "Command": "click",
  "Target": "id=EndV",
  "Value": ""
},

{
  "Command": "click",
  "Target": "id=EndN",
  "Value": ""
},
{
  "Command": "type",
  "Target": "id=EndN",
  "Value": "${!COL3}"
},


I’m really grateful for your help.

Why there is a space after ! ?

[error] Line 7: Internal variable “! COL2” not supported

Have you checked your macro code ?

Can you post the csv content please ?

Sorry, there is not space after ! on log, it was an error when I copied or typed. Yes, I checked the macro code. The csv is below. I tried to change the csv file encoding too (ASNI to UTF-8). I also checked that the extension was reading correctly from the HD. Unfortunately the error persists.

20234242;label=Avenida;516;APT 031;label=11º;00-33-300113-2000;0651111-3
20340004;label=Rua;105;BLC B/APT 337;label=10º;00-00-300361-2000;0333339-9
20273421;label=Rua;129;APT 104;label=11º;77-11-300003-2000;0600000-9
20341030;label=Rua;918;APT 103;label=11º;99-00-300363-2000;0600002-4
20513460;label=Rua;596;CAS 16;label=10º;11-44-300060-2000;0119002-6

Thanks.

I think the problem can be label=Avenida save always your csv in UTF8 because ANSI do not support special caracthers

Try to edit csv in this mode, using " " in every value and separe with comma ,

"20234242","Avenida","516","APT 031","11º","00-33-300113-2000","0651111-3"
"20340004","Rua","105","BLC B/APT 337","10º","00-00-300361-2000","0333339-9"
"20273421","Rua","129","APT 104","11º","77-11-300003-2000","0600000-9"
"20341030","Rua","918","APT 103","11º","99-00-300363-2000","0600002-4"
"20513460","Rua","596","CAS 16","10º","11-44-300060-2000","0119002-6"

And change this command from

{
  "Command": "select",
  "Target": "id=EndV",
  "Value": "${!COL2}"
},

Change In

{
  "Command": "select",
  "Target": "id=EndV",
  "Value": "label=${!COL2}"
},

I think now your macro work like a charm

1 Like

Oh! Its cool! Its run! Thank you very much! It was not necessary to change the “label”. Thank you!

1 Like

Hi,

I’ve exacty the same problem…

{
      "Command": "type",
      "Target": "id=downshift-0-input",
      "Value": "${!COL1}"
    },

I’ve put the line csvRead in the beginning of the code. But don’t know why it says “!Col1” not supported :slight_smile:

Thx for your help

@Nuj Does this short test macro work for you? It works fine for me.

{
  "Name": "csvtest",
  "CreationDate": "2021-2-14",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://ui.vision/contact",
      "Value": ""
    },
    {
      "Command": "csvRead",
      "Target": "readcsvtestdata.csv",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=ContactName",
      "Value": "${!col1}"
    }
  ]
}

Thx a lot for your message. Yes i’ve tried it, and the test macro works :slight_smile:

Yes i’ve tried it, and the test macro works :slight_smile:

But my macro still doesn’t…:frowning:

Please Help! :cold_sweat: