I have data that I'm getting from the G Suite Admin SDK that looks like this:
[{orgUnitPath=/Test, kind=admin#directory#orgUnit, blockInheritance=false, name=No Public Sharing, description=, etag="string", orgUnitId=id:00000, parentOrgUnitPath=/, parentOrgUnitId=id:111111}, ...]
How can I convert this into an array like this:
[[[orgunitpath, test],[orgunitid,000000]],[[orgunitpath, test],[orgunitid,000000]],[[orgunitpath, test2],[orgunitid,222222]],[[orgunitpath, test],[orgunitid,222222]]]
I'm ultiamtely looking to import this data into a SQL datasource in AppMaker.
You can easily do this with Array#map
var res; //[{orgUnitPath:/Test, orgUnitId:id:00000, parentOrgUnitPath=/, parentOrgUnitId=id:111111}, ...]
var array=res.map(function(obj){
return [['orgunitpath', obj['orgUnitPath']],['orgunitid',obj['orgUnitId']]]
})