Unable to retrieve the Last Name column form a excel spreadsheet. All other columns are read and then entered into a form but for some reason it will not accept the Last Name column. Any thoughts?
Message: Column ‘Last Name’ does not belong to table .
Exception Type: System.ArgumentException
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ArgumentException: Column ‘Last Name’ does not belong to table .
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)
@jmcentee1488 just check whether you are using the column name which is belongs to that table,if that belongs to that table make sure there are no spaces before the column name in that excel file.
Try this …first read the excel sheet then in for each try Datatable.Columns and after that display item in log or msgBox. It will show all the columns name available in you Excel Sheet.
Fine we can either mention with column index in the type into field as input
Like this row(1).Tostring
Where 1 index mention the column Last Name and usually the column index starts with 0
Or to find the column name exactly
Use simply a write line like this Yourdatatablename.Columns(0).ColumnName.ToString
This will print the column name of that column in write line Activity…
Well we can use that…
Fine lets check what is the name of that column using a write line activity
–put this in the write line activity that would output the column name in the output panel Yourdatatablename.Columns(0).ColumnName.ToString
to check the length of the columnname Yourdatatablename.Columns(0).ColumnName.ToString.Length
actually it should be 9
check whether it is 9 or not
we will come to know the issue buddy
Cheers @jmcentee1488
I went with row(1).ToString and that seem fairly stable. I still am trying to understand why it does not see the colname “Last Name”… As you can imagine this issue could pop up other places and I need to understand cause.
either the column name must have space in front or at back to name “Last Name”
like this " Last Name" or "Last Name ", which might not let the bot to the recognize the column name
The term Last Name must of two lines either, i hope it wont be but this can be checked only with this buddy Yourdatatablename.Columns(1).ColumnName.ToString
where here 1 denotes the column “Last Name”, we can check by just writing this in write line activity to check the actual issue, which would surely help us to solve the issue
Thats all buddy, these things must be the reason…else would be fine
Cheers @jmcentee1488
BlankProcess24 execution started
11:45:32.0000 => [INFO] [UiPath.Studio.Shared.Logging.OutputLogger] [40] Last Name
11:45:32.0000 => [ERROR] [UiPath.Studio.Shared.Logging.OutputLogger] [25] Type Into ‘INPUT Last Name’: Column ‘Last Name’ does not belong to table .
11:45:32.0000 => [INFO] [UiPath.Studio.Shared.Logging.OutputLogger] [22] BlankProcess24 execution ended in: 00:00:00
I still wonder why it didn’t
fine lets check the length of the string “Last Name” and it should be 9
Try with this buddy @jmcentee1488 Yourdatatablename.Columns(1).ColumnName.ToString.Length.ToString
It will not let me covert int to TS.
Compiler error(s) encountered processing expression “Names.Columns(1).ColumnName.ToString.Length”.
Option Strict On disallows implicit conversions from ‘Integer’ to ‘String’.
[/quote]