Can I see what's going wrong?

I have build a robot which extracts data from a crypto exchange via API.
I used an HTTP request which returns a string. This string is converted to an object via a Deserialize Json-activity. After that I have a Do While activity in which every row of the object is added to a DataTable. Therefore I used an Assign in which a array for each row is filled with 5 strings (sequence, price, size, side and time). This works most of the time well but sometimes I get an error at the point of assigning the array: Object reference not set to an instance of an object.

the array: {objJsonObject(“data”)(intRowCounter)(“sequence”).ToString,objJsonObject(“data”)(intRowCounter)(“price”).ToString,objJsonObject(“data”)(intRowCounter)(“size”).ToString,objJsonObject(“data”)(intRowCounter)(“side”).ToString,objJsonObject(“data”)(intRowCounter)(“time”).ToString}
objectJsonObject is the Object-variable
intRowCounter is an int32 in which the current row number is stored
sequence, price, size, side and time are the strings and columns of the DataTable.

What is going wrong at that moment and can I see it somewhere? Is there a way to avoid this?
Many thanks in advance!

Hi @Bureau_G ,

Most probably a Check needs to be performed whether the data is actually present and then proceed with the operation of extracting each value.

Normally we can check it like below :

objJsonObject("data") isNot Nothing

Also, a Debugging would help you to check what is the value of objJsonObject value and then conclude on what check to be done.

Great, many thanks!!!
I think I can use that for each row in the Object.
Is it also possible to check if each string in the array has a value?

Nobody has an answer…? :worried:

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