Unable to completely deserialize a complex type result in a REST Advanced SmartObject
kbt154682
PRODUCTIssue
You are currently chaining together many REST service object methods on an Advanced SmartObject. Your goal is to have the serialize and deserialize methods work together so that users/developers do not need to call many SmartObjects to get readable results instead of string arrays. Currently, after running the deserialize methods on the relevant SmartObjects tied to your REST objects, you will still get a serialized list as your result. It will show up in a column on the results named "Serialized Item (String)."
Symptoms
For the purpose of simplifying the symptoms, let's break down what your advanced SmartObject would be doing on the individual calls. Most likely the methods would look like this:
Let's say our result set looks like this after querying from the REST Service. Notice how we have multiple complex types in play:
Here we can see the first result is an object named Result2 which contains an array of type Table[]. This array Table[] contains many other objects of type Table. To get to our completely serialized ("Human Readable") data we need to deserialize against the relevant object types to break this result set down. So first we run the Deserialize method against the Result2 object. And in return we get the data below:
Next, to finally get to our actual serialized data we run the "Deserialize Array" method on the above data for the Table SmartObject. However, this still returns a result set of 4 objects of type Table as seen in the above screenshot.
Troubleshooting Steps
Due to the result containing many complex types that are related, we need to deserialize the data set taking into consideration that we have an array of typed values. If our result set looks like the above then we need to be sure we are using the method "Deserialize Typed Array" instead of "Deserialize Array". The Deserialized Typed Array method will provide the complete results in human readable format. Technically we are passing it an Array of many types, even if that type is the single object version of Table.
Once you run the "Deserialize Typed Array" method you would then get the results that look like this: