Got the error in Assign Activity: Exception has been thrown by the target of an invocation

Hi all,

I’m trying to get the name.

Why I got Assign: Exception has been thrown by the target of an invocation error? Any solution to resolve this?

@shubham.kamal
Debug your process so that you get some idea at what point this raising error

Hi @shubham.kamal

Can you share the syntax written in Assign activity

Regards

I got that error after debug…I know the activity where it occurring but not sure why

Here, I’m using Assign inside the For Each Row in Data Table. Syntax is: CurrentRow(“Name_1”).ToString

Hi @shubham.kamal

Can you share the Save To Value also

Regards

@shubham.kamal

Check your assign activity has Null values

Hi @shubham.kamal

Typically occurs when there is no value to assign. Check for any null values in the Assign activity.

I think CurrentRow(“Name_1”) has null value.

To avoid null values, I have used If statement instead of Assign activity but still the same issue.

To avoid null, I have used If statement instead of Assign but still same issue.

Save To: dtNGTemplate.Rows(rowCounter)(“sourceUrlUpdates[details][names][FIRST_NAME]”)

@shubham.kamal

Try to remove unused variables and arguments in your project.

Still the same error🙁

@shubham.kamal

Check all the variables and arguments printing the value in message box or write cell if its getting any value or null. And check the column names and data in the datatable.

Initialize the collection types like array, dictionary, datatable before adding the data to the empty collections.

And check all the datatypes of the variables.

@shubham.kamal
in if condition try to use this

 Not String.IsNullOrEmpty(yourValue) AndAlso Not yourValue.Trim().Equals("")

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