Error --> Assign: Exception has been thrown by the target of an invocation

Hello, currently I am trying to obtain a loop of the director’s name with the use of Datatable. However, it keeps appearing the error of Assign: Exception has been thrown by the target of an invocation.

In my Datatable, the name is DirectorName and this is my formula in the
For Each → row.item(“Field”).ToString = “DirectorName”.

If anyone can solve this it would be a huge help as I’ve tried looking through the UiPath Forums and non of it helped.

r/UiPath - Assign: Exception has been thrown by the target of an invocation.

r/UiPath - Assign: Exception has been thrown by the target of an invocation.

2 Likes

@Kian

Can you tell me what you are assigning?

Do you want to set the value to the Datatable back?

If so, then you have to write as
DT.Rows(index).Item("ColumnName").ToString = "Your Value"

Where Index is the variable created for For Each row Index in properties

For reference you can check as below

Hope this helps you

Thanks

Currently I am trying to assign–> For each information extracted for Director’s Name, input it onto the next row. The director name is inputted in the DataTable as per picture shown above. And that my flow was to extract for each director’s name in the Pdf file, and input it into excel in a new row.
But then it keeps appearing the error as per the tile of this thread.

To clarify further, the error occurs at this assign as shown in the picture.

To: row.item(“Values”+ValueNum.ToString) Value: item.ToString

Is there anyway I can work around this? Please help thank you @Srini84

@Kian

Can you share a sample workflow, PDf file you are using, so that we can check and debug the issue

As i told you before for writing into the row, You can check as below
DT.Rows(index).Item("ColumnName").ToString = "Your Value"

Thanks

Example.pdf (115.6 KB) CP_-_REGEX.xaml (26.5 KB) RPA_Excel Template 1.xlsx (16.6 KB)
As per above is my RPA workflow, a PDF example and my Excel sheet which i wish to extract the PDF information onto.
I’ve tried the formula but did not really understand how to implement it. Is there any way that you might be able to help me? @Srini84

Do let me know if you need more additional info

@Srini84

Hi is there any way to work around this problem?

Hi Kian
this is a very typical Uipath error which I had several times since years. I googled thsi error multiple times, never had any result (as right now).
Just answering to keep the topic on top.