AnsweredAssumed Answered

I'd like to parse complex JSON.

Question asked by thomasgpeters on May 23, 2018
Latest reply on May 23, 2018 by ThierryGuemboura

Focusing on succinctProperties highlighted below, in the example Input JSON, I would like to write a script that grabs the property names using JSONElementKeys then loping through to get the value for each.  For each I would like to insert the name and the value into related record(s).

 

Input JSON

{

    "object" :

    {

        "propertiesExtension" :

        {

            "aspects" :

            {

                "appliedAspects" : [ "P:rn:renditioned", "P:cm:ownable", "P:cm:titled", "P:sys:localized" ],

                "properties" :

                {

                    "propertyString" :

                    [

                        {

                            "value" : "admin"

                        },

                        {

                            "value" : "Project Objectives.ppt"

                        },

                        null

                    ]

                }

            }

        },

        "succinctProperties" :

        {

            "alfcmis:nodeRef" : "workspace://SpacesStore/5515d3e1-bb2a-42ed-833c-52802a367033",

            "cm:description" : null,

            "cm:owner" : "admin",

            "cm:title" : "Project Objectives.ppt",

            "cmis:baseTypeId" : "cmis:document",

            "cmis:changeToken" : null,

            "cmis:checkinComment" : null,

            "cmis:contentStreamFileName" : "Project Objectives.ppt",

            "cmis:contentStreamId" : "store://2018/4/8/13/5/ee55c551-8288-4122-9b31-3a2fb6f83a3c.bin",

            "cmis:contentStreamLength" : 2117632,

            "cmis:contentStreamMimeType" : "application/vnd.ms-powerpoint",

            "cmis:createdBy" : "mjackson",

            "cmis:creationDate" : 1299148290596,

            "cmis:description" : null,

            "cmis:isImmutable" : false,

            "cmis:isLatestMajorVersion" : true,

            "cmis:isLatestVersion" : true,

            "cmis:isMajorVersion" : true,

            "cmis:isPrivateWorkingCopy" : false,

            "cmis:isVersionSeriesCheckedOut" : false,

            "cmis:lastModificationDate" : 1299148291651,

            "cmis:lastModifiedBy" : "mjackson",

            "cmis:name" : "Project Objectives.ppt",

            "cmis:objectId" : "5515d3e1-bb2a-42ed-833c-52802a367033;1.0",

            "cmis:objectTypeId" : "cmis:document",

            "cmis:secondaryObjectTypeIds" : [ "P:rn:renditioned", "P:cm:ownable", "P:cm:titled", "P:sys:localized" ],

            "cmis:versionLabel" : "1.0",

            "cmis:versionSeriesCheckedOutBy" : null,

            "cmis:versionSeriesCheckedOutId" : null,

            "cmis:versionSeriesId" : "5515d3e1-bb2a-42ed-833c-52802a367033"

        }

    }

}

 

Here you will see I am playing around with the elements in the JSON.  But, I wonder if there is someone that can help out?

 

Best Regards...

Thomas

Imagery Business Systems, LLC

Outcomes