Re: Pretty Print JSON uniPaaS v1.9p


Steven Blank
 

The devil is indeed in the detials. You have to reverse your going-in flow, when going out.

;)

Steve Blank

At 06:24 PM 8/5/2017, you wrote:
Steve,
This should get you close. The syntax may be off.

Update A with repstr(A,',"',asciichr(10)&',"')
Update A with repstr(A,'{',asciichr(10)&'{')
Update A with repstr(A,'}',asciichr(10)&'}')
Update A with repstr(A,'[',asciichr(10)&'[')
Update A with repstr(A,']',asciichr(10)&']')

Todd

On 8/5/2017 8:22 PM, Steven Blank wrote:
Friends,

An online program calls a local web service to perform a certain action via HTTPCALL(). This web service returns a JSON response, similar to the following:

{"Version":"1.0","Status":"RanToCompletion","WaitStatus":"Completed","Validated":true,"Messages":[{"ActionName":"Print UCC-128 Label","Level":2,"Text":"BarTender successfully sent the print job to the spooler.\r\n\r\nJob Name: template.btw\r\nDocument: template.btw\r\nPrinter: \\\\\\\\CAROL\\\\Samsung ML-2510 Series"},{"ActionName":"Print UCC-128 Label","Level":2,"Text":"The BarTender Print script \u0027Print UCC-128 Label\u0027 completed successfully."}]}

I would like to display this response for the user in a Magic online task, but I'd really like to make it easier to digest by dressing it up some, perhaps similar to this:

{
"Version": "1.0",
"Status": "RanToCompletion",
"WaitStatus": "Completed",
"Validated": true,
"Messages": [
{
"ActionName": "Print UCC-128 Label",
"Level": 2,
"Text": "BarTender successfully sent the print job to the spooler.\r\n\r\nJob Name: template.btw\r\nDocument: template.btw\r\nPrinter: \\\\\\\\CAROL\\\\Samsung ML-2510 Series"
},
{
"ActionName": "Print UCC-128 Label",
"Level": 2,
"Text": "The BarTender Print script 'Print UCC-128 Label' completed successfully."
}
]
}

Clearly, a translation is the answer, but what and how? I thought about embedding a web browser on a Magic for and displaying in that.
Remembering that this is uniPaaS v1.9p and that I, as a result, do NOT have the benefit of dotNet in this online task, can someone suggest a tool or technique I can


Join main@magicu-l.groups.io to automatically receive all group messages.