JSON object to string in server connect?

Hi all,

I’ve got some output from a query that I would like to use in building a JSON string to pass to API action for a remote service (PDF generation). It’s returning as [object] …

e.g.

{
“document”: {
“document_template_id”: “E96C0C9B-20BF-4F49-AD99-4555FFF5”,
“payload”: { “property” :“property” : [object Object], “bid_details” : [object Object] },
“status”: “pending”
}
}

What’s the easiest way to convert those JSON objects to strings ?

I’ve tried _var.stringify() but it’s throwing an error

stack: “Error: Parser Error: Formatter “stringify” does not exist, expression {{_startJSON+’ “property” :’+_propertyJSON.stringify()+’, “bid_details” : '+_offerJSON.stringify()+_closingJSON}}\n at /opt/node_app/lib/core/parser.js:698:27\n at /opt/node_app/lib/core/parser.js:665:25\n at + (/opt/node_app/lib/core/parser.js:50:45)\n at /opt/node_app/lib/core/parser.js:421:42\n at + (/opt/node_app/lib/core/parser.js:50:36)\n at /opt/node_app/lib/core/parser.js:421:42\n at + (/opt/node_app/lib/core/parser.js:50:36)\n at /opt/node_app/lib/core/parser.js:421:42\n at + (/opt/node_app/lib/core/parser.js:50:36)\n at /opt/node_app/lib/core/parser.js:421:42”

All help most welcome …

Thanks as ever…

Hi.
There are two built-in formatters - toJSON and parseJSON.

But they are not visible in the UI, so you will have to type it out.

Thanks Sid.

That’s worked for me.

I do wonder why someone doesn’t take the time to add such items to the UI and document them. It seems such a waste to do all this good work and leave it undiscovered with poor or non-existent coverage.

Rant over. Thanks again.

1 Like

I agree, I’ve spent an hour to find out how to write it but it should have been in the UI in the first place and available in a click :slight_smile:

1 Like