Exception Type: JsonSerializationException

studio
variable

#1

Hello there,

I have the error message saying: “Unable to find a constructor to use for type System.Data.DataRow. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path ‘Output.out_WIList.$values[0].RowError’, line 1, position 5762.”

This happens when I extract the Data table and assign it to System.Data.DataRow[]. Have you ever experienced this issue? Can you advise please?


#2

What exactly are you trying to assign? - you can’t directly assign a data table to an array of data rows…


#3

I faced the same exception! when I am assigning a datarow array variable to another datarow array argument.
jsonConstructor attribute. Path ‘Output.out_WIList.$values[0].RowError’, line 1, position 143.


#4

while assigning Datarow[ ] variable to datarow[ ] argument


#6

same for me when assigning a datarow-array to an argument


#7

I have a same problem, please help!!!


#8

Hi there @radovan.bordovsky,
How are you converting your DataTable to a DataRow[]?

I have just tested this on my machine, converting my initial DT using:

out_ArrDataRows = dtExample.AsEnumerable.ToArray

I then had the resultant Argument (out_ArrDataRows) passed out successfully?

Can you clarify on what you are trying to achieve?

Thanks,
Josh


#9

Have same problem.


#10

It could be different to topic starter, but I bump into this message when I assign DataRow[] variable to DataRow[] argument


#11

Hi there Ancher,
Can you provide an example snippet on how you are achiving this?

Thanks,
Josh


#12

System1_ExtractWorkItems.xaml (9.7 KB)


#13

and the message I get once I run it


#14

Hi there @Ancher,
Apologies, I will take a look at this momentarily :slight_smile:

Thanks,
Josh


#15

Hi there @Ancher,
I’ve run the provided workflow twice with success.

Once in isolation and once from elsewhere.

If you go to the output pane, are you receiving this error before, or after the final Log message?

Thanks in advance,
Josh


#16

Hard to tell, final log line and pop up message come up at about same time.


#17

If you will run that workflow by invoking then it will work and if you will try to run directly then it will give the exception after running all activities.


#18

it’s right? but I not know how to do


#19

Hi @miracle

Let me say all that I know about this exception.
Isolated Invocation:
All the output arguments should be Serializable one. Arguments that aren’t Serializable like BrowserElement will throw this expection
Not Isolated:
One can use Non-Serializable arguments, however the workflow will throw the same Exception if run independently i.e you just run this workflow alone. Will NOT throw Exception if invoked elsewhere


Workbook write cell error
#20

I was successed solved this problem,thanks


#21

@miracle Can you let us know, how did you resolve issue?