I’m writing a server-side plugin that returns an object, and after working through the context.async syntax and getting the plugin to return on an object, I now have a new and interesting issue.
I know the plugin returns the object I want because there is a console.log() statement in the plugin that outputs it to the server log.
The console.log() statement is below.
console.log("CustomPlugin:getLinks:objectToReturn:try3: ", objectToReturn)
And I can see the object from that statement in the server log, as shown below.
However, as the plugin is not fully done, I’m taking baby steps and testing it again after each code addition.
I want to, within Bubble, stringify the object so I can display it in a Text element.
And herein lies the problem.
I’ve experimented with:
Javascript Toolbox - Run javascript
Javascript Toolbox - Server Script
jsoNest Plugin for Bubble
But I’m not figuring out how to address or reference the object correctly.
For example, here is a screenshot of me trying to use Run javascript to simply “console.log()” the object, which in a browser or a Node JS script, just works.
The issue is that the object is not text, which of course it isn’t.
For what it’s worth, Bubble did create an object property named “raw body text” that I did not define, and I tried it, but it seems to be always empty.
Does anyone know how to do a
let objectTextRepresentation = JSON.stringify(object)
console.log(objectTextRepresentation)
in Bubble?