How to reference a column of a DataTable by name when there is a newline between two words

I am using the read range activity to map Excel data to a data table.

The third column’s text has a line break. I just want to reference this column by name in my DataTable because if it were to be referenced by number, I might need to change the numbering system every time we add a new column to this Excel sheet.

Here is a screenshot of the process where I map the excel data onto a datatable and then get the CurrentRow based on the current RowIndex (this is for when the process is iterated). I then reference the cell I want using the Item method to reference the column. This usually works with other columns but with the "Work " + vbnewline + “Order” column it does not. I’ve tried it with a space after “Work”, with no space, and without the newline. Each time I was presented with this kind of error.

I’ve had this happen every time I try to reference a DataTable header with a newline in it in the whole 7 months I’ve been using UiPath. Is this a bug or a feature? I figured it was more likely I am making some kind of mistake so please if you know what is going on here let me know.

Here is the excel sheet with the header in question active.


How about the following?



"Work "+vblf+"Order"


I tried the second one

"Work " + vblf + "Order"

and it worked!! Thank you so much for the quick solution! Today I’ve learned something new!

1 Like

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