Forum Discussion

girishrawat's avatar
girishrawat
New Contributor
2 years ago

Split the Arrays inside a JSON object with as many rows as there are objects

{
"Region": "Asia Pacific",
"Office": "Australia",
"Location": [
{
"name": "Brisbane",
"Latitude": "-27.4690555",
"Longitude": "153.0286812",
"OfficeAddress": "Suite 4, L20 10 Eagle Street,Brisbane, Queensland, 4000,Australia"
},
{
"name": "Canberra",
"Latitude": "-35.3084798",
"Longitude": "149.1304273",
"OfficeAddress": "Unit 8, Level 2, 11 National Circuit,Barton, ACT, 2600,Australia"
},
{
"name": "Melbourne",
"Latitude": "-37.814090",
"Longitude": "144.970970",
"OfficeAddress": "Level 31, South Tower,80 Collins Street,Melbourne, Victoria 3000,Australia"
},
{
"name": "Perth",
"Latitude": "-31.9556291",
"Longitude": "115.8533297",
"OfficeAddress": "Suite 4.02, Level 4,1 William St,Perth, Western Australia, 6000,Australia"
},
{
"name": "Sydney",
"Latitude": "-33.86488",
"Longitude": "151.21192",
"OfficeAddress": "88 Phillip Street, 35th Floor,,Sydney, New South Wales, 2000,Australia"
},
{
"name": "Sydney - Experience Studio",
"Latitude": "-33.86488",
"Longitude": "151.21192",
"OfficeAddress": "88 Phillip Street,35th Floor,Sydney, New South Wales, 2000,Australia"
},
{
"name": "Sydney",
"Latitude": "-33.86488",
"Longitude": "151.21192",
"OfficeAddress": "88 Phillip Street,35th Floor,Sydney, New South Wales, 2000,Australia"
}
]
}

I needed output something as how this can be done? I am trying using json splitter but that works only on one column. This is sample of one Location and Region there are hundreds like them.

 

REGIONOFFICELOCATION_NAMELOCATION_OFFICEADDRESSLOCATION_LONGITUDELOCATION_LATITUDE
Asia PacificAustraliaBrisbaneSuite 4, L20 10 Eagle Street,Brisbane, Queensland, 4000,Australia153.0286812-27.4690555
Asia PacificAustraliaCanberraUnit 8, Level 2, 11 National Circuit,Barton, ACT, 2600,Australia149.1304273-35.3084798
Asia PacificAustraliaMelbourneLevel 31, South Tower,80 Collins Street,Melbourne, Victoria 3000,Australia144.97097-37.81409
Asia PacificAustraliaPerthSuite 4.02, Level 4,1 William St,Perth, Western Australia, 6000,Australia115.8533297-31.9556291

3 Replies

  • This expression should help $Location.map(x => x.extend({"Office":$Office, "Region":$Region}))

    Please note

    • You may have to replace the quotes if you copy.
  • svatada's avatar
    svatada
    Former Employee

    girishrawat You can achieve your usecase using json splitter snap. Following are the jsonsplitter snap settings.