0

I am new to UiPath. I have an excel with 4 columns: First name, Last Name, Age, Email. When data is read from the excel, all the columns are displayed in message log except Age which is an Integer. The error message I get is "Message: Column 'Age' does not belong to table DataTable.".Below is my code for Read Data from excel:

"Customer details"+" "
       +customer.Item("First Name").ToString+""
       +customer.Item("Last Name").ToString+""
       +customer.Item("Age").ToString+""
       +customer.Item("Email").ToString

Can you please hep with the issue pertaining to printing the Age.

Luuk
  • 12,245
  • 5
  • 22
  • 33
user3086267
  • 41
  • 1
  • 2
  • How did you define the `DataTable` ? – Luuk Jun 26 '21 at 10:17
  • Check if Age is showed in Debugging. – kwoxer Jun 27 '21 at 05:02
  • @kwoxer- In debug mode I get this message-Log Message: Column 'Age' does not belong to table DataTable. – user3086267 Jun 27 '21 at 06:10
  • @Luuk - In the Read Range activity, I have set MyCustomers as variable in Output->DataTable field – user3086267 Jun 27 '21 at 06:13
  • You should check the definition for `Customer`, as it seems not to have a column/field/... `Age`. – Luuk Jun 27 '21 at 07:05
  • I changed my column name from Age to Ages and the error went away. Not sure why .. :) – user3086267 Jun 27 '21 at 07:38
  • Odds are good the excel file that was creating the datatable did include a column named Age, but likely with a trailing space, meaning that the code above failed. When the OP changed it to Ages in the excel file and then the code, problem vanishes like magic – Dave Jul 21 '21 at 20:33

0 Answers0