Getting error "assign exception has been thrown by the target of an invocation"

Hi All,

I have an error which is always throwing this error
“assign exception has been thrown by the target of an invocation”
As that variable has values it’s throwing errors.

so if there’s a solution please let me know it as soon as possible.

Hi
Is this assign used inside any loop
Cheers @SOURAV_KUMAR_DAS

1 Like

Hi Palaniyappan Sir,

Yes Sir.

That’s the issue
If that assign is used in a for each or for each row loop and if the TO property variable is from that loop then it will show
Like if we are trying to modify a element or delete a element from the variable that the loop is iterating with then we will face this issue
Cheers @SOURAV_KUMAR_DAS

2 Likes

Hi Palaniyappan Sir,

So is there any solution Sir.

Kindly elaborate the process pls
Cheers @SOURAV_KUMAR_DAS

1 Like

Hi Palaniyappan Sir,

Sure Sir,

  1. At first I am scrapping out the data from a website using Data Scrapping, to get the names and URL’s.

  2. And Iterating through the URL want to scrape the extra data’s and write it in Excel sheet.

This goes on for each URL’s and I am getting error in the (2) step.

So is there any solution please let me know Sir.

1 Like

Hi Palaniyappan Sir,

Then will it work in flowchart and that flowchart will be in for each loop?

Hi All,

If there’s a solution for my above problem let me know it as soon as possible.

@SOURAV_KUMAR_DAS
Can you share sample for your code?

1 Like

I will send you the screenshot.

Ok Share it here please.

Let’s take like we have a datatable named dt
Now that dt will be having data in it under a column named url

Now use a For each row activity and inside that use a Open browser activity
Where mention the url as row(“yourcolumnname”).ToString

Cheers @SOURAV_KUMAR_DAS

1 Like

Done the process Sir.
Inside For each what I should do to scrape those data’s

Hi Sir,

Below is the screenshot for the verification Sir.

So these are the screen shots Sir.

Hi @SOURAV_KUMAR_DAS
Did you find a solution to this? I am facing the same issue.

Hi all! Although this reply comes very late, I’m going to leave it here as it may help others who encounter such an issue in the future.

The exception in this message (although it seems vague) shows that the Assign is not the source of the exception. In this case it’s useful to have a look at the exception details; there, you can find the clue as to what happened. image

In my case (and I believe this is also what happened to others) it was this:

Cannot set column ‘XXXX’. The value violates the MaxLength limit of this column.

By default, a DataTable Column of type String has a maximum length of 100 characters. If you try to assign a string value of greater length, this is the exception thrown. The simple fix, for this case, is to increase the MaxLength property of the column to a value that can accommodate the longest string you expect to have.

Cheers,
Alex.

11 Likes

hello there…!! actually im facing this error and i increase the maxlength but still i facing that error

and my input value is 99.22

error is:-Assign: Exception has been thrown by the target of an invocation.

Hi @swanand_deshmukh!

What is the type defined for the column? And how are you assigning the value to it?

Also, can you please get the Exception details (by clicking on the “Details” button, as shown in my message) and post the entire exception here?

Cheers!

i define column as string in build data table
and, i assign value dataRow(“Column_name”)=row(2).tostring

1 Like