What's the best way to debug JSON output?

Hi there, I’m trying to debug an APL display that’s not working, and I’ve isolated the problem to a list I’m generating with Javascript and passing in as a variable to the data source JSON. My hunch is that I’m not building the json objects correctly, but I’m having a hard time verifying that.

In the debug view, I can see that I’m setting a variable that’s an array of objects, but I can’t see the contents of those objects. I in the debug logs and in a speak block, all I can see is:

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

It would be awesome if there was something like console.log(myObj) that I could drop in my code to see the contents of these objects. Does something like that exist? Or otherwise, any other tips on how to debug JSON?

1 Like

I ended up figuring this out. When setting the object, just save with JSON.stringify(obj) and the full object will show up in the debug logs.

This post really helped me figure it all out.

Turns out I had some problems with my code AND I wasn’t stringifying the output before sending it to the APL block.

1 Like

Thanks for the feedback and your solution Robby!