Using Invoke Method to add DataTable into another DataTable

Hi,

I try to extract Two data table from browser, and I have successful extract both DataTable (ExtractDataTable & ExtractDataTable2). and now I try to use Invoke method to add ExtractDataTable2’s rows into ExtractDataTable. (Combine both table)

but I get Exception error as following:

*RemoteException wrapping System.ArgumentException: This row already belongs to another table. *

  • at System.Activities.Statements.MethodExecutor.InvokeAndUnwrapExceptions(Func`3 func,*
    Object targetInstance,
    Object[] actualParameters)
  • at System.Activities.Statements.MethodResolver.SyncMethodExecutor.BeginMakeMethodCall(AsyncCodeActivityContext context,*
    Object target,
    AsyncCallback callback,
    Object state)
  • at System.Activities.Statements.MethodExecutor.BeginExecuteMethod(AsyncCodeActivityContext context,*
    AsyncCallback callback,
    Object state)
  • at System.Activities.Statements.InvokeMethod.BeginExecute(AsyncCodeActivityContext context,*
    AsyncCallback callback,
    Object state)
  • at System.Activities.AsyncCodeActivity.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)

Both Tables have data.
image

Here is my Invoke Method:


image

Any ideas?

Hello @Nox_Lee

Few things to correct here.

Target object of the invoke method should have the value ExtractDataTable. Remove the .rows part

Method name is not Add . It should be ImportRow

And for the input arguments add the row coming from other datatable. So as you have here, invoke method should be inside a for each row loop that loops through the other data table which you want to get data of.

Do the changes and it will work for you


Excellence is achieved through constant challenging and breaking off from your limitations. It isn’t taught or given; it begins within you. – @Lahiru.Fernando

1 Like

Hi @Lahiru.Fernando

Thanks, It works!

1 Like

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