Add data column - unwanted extra columns

Hi,

I am using the “add data column” activities to add several columns.

Unfortunately, in my excel file I first have the same amount of columns as ‘column1’, ‘column2’, etc before my real columns are added:

What am I missing?

Thanks

Hi @yannip,
Do you mean that you would like to add your columns in some particular position - e.g. before “column1” and the others? “Add data column” adds a new column as the last one. To move it, you need to add an extra activity - please see below - you assign the position using “Parameters” - e.g. Value 2 moves the new column to column C.


add column2.xaml (6.5 KB)
Does this help?

Hi @PAD,

Thanks for your reply.

Sorry if I was not clear. That is not what I meant.
I wanted to add the column SC by using ‘add data column’, but the columns before (RL - SB) got added as well without asking for it.

@qateam

Are you able to recreate this error using other excel sheets? I’ve never encountered it.

I think there’s a possibility that RL - SB had some sort of formatting or values in the excel sheet, so UiPath is recognizing that and including it as part of your datatable. Try selecting all of the columns RL - SB, deleting the entire columns, saving, then try using the read range activity again to see if those columns are still part of the datatable

How I encountered it:

  • I tested my bot and it created the columns in the excel file (correctly)
  • I manually deleted these columns out of the excel file
  • I did some extra things in developping the bot and re-ran the bot and then it gave me the extra unwanted columns.

@yannip, I don’t know for sure but when you delete cells in Excel, sometimes it still sees those empty cells as having data. If that is the reason, then use the Clear All on those cells so it removes the information completely.
image