JSONReadable ( JSON )
Make larger JSON objects and arrays readable
Be the first to rate this function Log in to vote
David A Sullivan - Show more from this author
Mandelbrot LLC http://mandelbrotllc.com |
where $json =
{
"messages" :
[
{
"code" : "0",
"message" : "OK"
}
],
"response" :
{
"data" :
[
{
"fieldData" :
{
"ID" : "FB1",
"Name" : "Donuts",
"Stock" : 43
},
"modId" : "6",
"portalData" : {},
"recordId" : "1"
}
],
"dataInfo" :
{
"database" : "Favorite Bakery",
"foundCount" : 3,
"layout" : "Products",
"returnedCount" : 1,
"table" : "Products",
"totalRecordCount" : 3
}
}
}
{"code" : "0",
"message" : "OK" }],
"response" : {"data" : [
{"fieldData" : {"ID" : "FB1",
"Name" : "Donuts",
"Stock" : 43 },
"modId" : "6",
"portalData" : {},
"recordId" : "1" }],
"dataInfo" : {"database" : "Favorite Bakery",
"foundCount" : 3,
"layout" : "Products",
"returnedCount" : 1,
"table" : "Products",
"totalRecordCount" : 3 } } }
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Instead of having to copy/paste the value into a larger JSON editor when debugging or viewing JSON fields, use this function to condense the JSON down to a human-readable format.
After you get a few layers deep into arrays and objects, the spacing after the leftmost bracket can get a bit wonky. I'm open to suggestions as to how to fix that.
Aside from that one little cosmetic issue, the JSON it gets is the JSON you see.
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.