Issue in Assign: Exception has been thrown by the target of an invocation

Hi team,

When i am trying to add value to column TR then i am getting this error in assign activity.
Please help me to solve this.

Regards,
Bhagyashree

Hi,

For now, can you try to share content of $exceptionDetails in Locals Panel?

image

Regards,

RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.ArgumentException: Column ‘TR’ does not belong to table DataTable.
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.set_Item(String columnName,
Object value)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target,
Object arguments,
Signature sig,
Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object parameters,
Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr,
Binder binder,
Object parameters,
CultureInfo culture)
at System.Activities.ExpressionUtilities.IndexerLocationFactory1.IndexerLocation.set_Value(T value) at System.Activities.Location1.ReferenceLocation.set_Value(T value)
at System.Activities.ActivityContext.SetValueCore[T](LocationReference locationReference,
T value)
at System.Activities.ActivityContext.SetValue[T](LocationReference locationReference,
T value)
at System.Activities.Argument.Set(ActivityContext context,
Object value)
at System.Activities.Statements.Assign.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Hi,

The message show there is no column named “TR” in your datatable.
Can you check your column name in details? (If there is extra whitespace etc.)

Regards,

Already there is column name TR in sheet2

Hi,

Can you share content of the datatable in Locals Panel when error occurs?

Regards,

HI,

There seems no TR column. Is this from DataScraping? Perhaps you should review it.

Regards,

This is datascrapping value

Hi,

Can you check if there is TR column in preview of DataScraping wizard?

Regards,

Hi,

I mean can you check if TR column exists using preview of DataScraping wizard, as the following?
(The following is screenshot of modern data extraction.)

Regards,

In datascrapping TR doesnt exist.
TR is the column name which i want to add those outputs in TR column

Hello @_Bhagyashree
Instead of the column name can you try with the index.

row.item(0).ToString

Thanks

hi,

TR is the column name which i want to add those outputs in TR column

Do you want to write it to TR column of Excel or DataTable?
Can you elaborate?

Regards,

I want to write the outputs in TR column of excel table.

Strout is the output of get text activity and i have assigned row.item(“TR”) = Strout

Hi @Rahul_Unnikrishnan

Hi,

Does TR column already exist in your workbook?

If so, first, Read the table from workbook using ReadRange activity.
Then DataTable which has TR column will be created.
Next, input your value to the TR Column in DataTable using ForEachRow activity.

Finally, write back it to workbook using WriteRange activity.

Regards,

Hi @Yoichi

Flowchart2.xaml (134.6 KB)

Hi,

Can you check content of Data1 variable in Locals panel when error occurs?

Regards,

Hi,

Is there TR column in Tasklist.xlsx?
If yes, you need to review read from it.
If not, you need to add new column named “TR”

Regards,