Read Range Column Exists error

Hello Forum,
I’m Having this error with a Read Range and i don’t know the reason of it.
Any Clue?


1 Like

Hi @Luis_Fernando,

It’s because you have two columns with the same name (column J and K).

You can rename one of them and this error will not happen anymore (you can use a write cell activity before reading it to do that and use cell “J4” or “K4” as input, if they don’t change positions.)

There is another option to solve this problem, which is to uncheck AddHeaders property from the read range activity. This way, the columns will be renamed as “Column1”, “Column2”, “Column3” and so on…

Then, to get some value you can use this auto-generated name or even the index.
Example1: row("Column1").toString
Example2: row(0).toString

If this solves your problem and you agree, kindly mark the post that helped you the most as solution to close this topic.

If you need extra help and/or have any questions, please let me know :slight_smile:

Thanks!

Hi @Luis_Fernando,

If you don’t want to deal with editing the renewed name, you can read without getting the column names. In this way, it will name all the columns by itself.
image

Regards,
MY

1 Like

Hello @Luis_Fernando

When ever if you are trying to read an excel using read range activity there should not be duplicate headers as it can throw the error. So either you can disable add header property in the properties, then Read range will not consider the headers .

Else before to the read range make sure the header values are different.

1 Like

The problem is your column headers are broken across two lines.

So instead of “Dinero En Caja Cash” and “Dinero En Caja Trans” you have two columns named “Dinero En Caja”

What you could do is Read Range with “add headers” not checked, and read from A4.

So now your two header rows will be the first two rows of your datatable. You can then use that to rename the columns, concatenating the value of the first two rows for each column to get the full column header name.

Or as others have suggested, if the column order is always the same, you can just read from A6 and your column headers will be Column0, Column1, Column2, etc.

image

image

(the left part of the assign is columnItem.ColumnName)

image

Now the columns have been renamed using the first two rows as headers:

image

Then you can remove the first two rows.

1 Like

Thank you very much

1 Like

Thank You very much

1 Like

Thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.