How to set Excel header as Datatable column name

How to set Excel header as Datatable column name ?

If I choose add header and I could not get the records based on column name. Its saying column nname not belongs to table

If I remove add header and now Datatable columns comes as below column0 column1 column2 …

I need excel header as column in datatable

2 Likes

Hi @kaliraj1982,

Are you using the Read Range activity?

1 Like

Hi @kaliraj1982

“Its saying column nname not belongs to table ” ----- Have you checked the column name you used in other activity?
Assuming you need to use it in ‘Write Line’ activity, like row(“column name”), please check the words spelling or any space.

Thanks,
Aisling

Yes.

But, I need to get columns dynamically. Because, Sometimes we are having nearly 100 columsn in excel. So its not feesible to do like that…

Please try checking the column names if it matches. Sometimes a single space can make a difference :slight_smile:
Or you can use column indexes :slight_smile:

1 Like

Yes. Checked. Same issue. Actually, I if remove add header and now I can get values based on Column0,column1 like that. But, since its columns are changing dynamicaaly. Thats not worked out.

1 Like

Can you send the excel file?
If it contains sensitive information, please replace it with dummy values :slight_smile:

1 Like

Actually, I am working in client VDI. I am not supposed to do the same. Here the excel columns positioning also not same always. Like it will come like below

  1. ID Name Prodcut groupcode materioal code Bank location code amount
  2. Bank location code amount ID Name Prodcut groupcode materioal code
  3. Amount ID Name Bank location code Prodcut groupcode materioal code

Nearly 100 columns . Everytime changing the postions.

1 Like

I shared dummy records in above post. Please check

  1. Try to copy paste the column name in excel in a notepad.
  2. now paste the column name you provided in the code just below the pasted column name from excel. It may be because of a small space which is not much noticeable.

Also try manually changing the column names without any space. I mean to check whether the space in between the column names is creating the issue. change manually the column names in excel like below and try your operation( If the columns names are all separate then ignore)

Your columns : 1. ID Name Prodcut groupcode materioal code Bank location code amount (10 columns)

  1. ID Name Prodcut_groupcode materioal_code Bank_locationcode amount (6 columns)