Column 'XYZ' Doesnt't belong to the table

Hello,

I have a problem with my robot
When I try to compile, I get an error:
RemoteException wrapping System.ArgumentException: Column ‘first name’ does not belong to table DataTable.
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

This is my excel file:

first name last name gender address city state home phone work phone work email personal email

I am trying to create a robot that captures data from excel
Below is an part my robot which is the problem

In my opinion the problem is text int the field type into : customersData(rowNumber)(“first name”).toString

I don’t know how to change customersData (rowNumber) (“last name”). ToString

to make it work

Hi @Lukasz_Krasniak

Is this inside for each row and also is first name column present in the datatable…

Yes, the problem is for each row If i try rename of column

@Lukasz_Krasniak
check the EXCEL in the first row if the values taken for the column names are free of surrounding spaces etc.
Ensure Add header is ticked on for read range

in case it is not working after this:

  • debug the bot and inspect the content of the datatable
  • use immediate panel and type in youdDataTableVar.Columns(0).ColumnName and inspect the column name returned from this

I did debugging my project and I have information that my whole robot ‘dooesn’t belong to DataTable’

There is no empty space in the excel file

Can you show the excel file you are reading…

YES NO PROBLEM

Just to check In read range have you checked Addheader property…

Thanks @prasath_S Actually, the Addheader checkbox was unchecked and it worked :slight_smile:
Thanks so much !!! :slight_smile:

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