skip to Main Content

I have following input JSON request :

{
  "RootElement": [
    {
      "External_Contact_ID": "6504668",
      "Email_Address": "[email protected]",
      "First_Name": "Test_Name",
      "Last_Name": "TestLastName",
      "Member_STATUS": "ACTIVE"
    },
    {
      "External_Contact_ID": "6506709",
      "Email_Address": "[email protected]",
      "First_Name": "Test_Name1",
      "Last_Name": "TestLastName1",
      "Member_STATUS": "ACTIVE"
    }
  ]
}

want to remove the root element from the input JSON and transform it into below format :

[
  {
    "External_Contact_ID": "6504668",
    "Email_Address": "[email protected]",
    "First_Name": "Test_Name",
    "Last_Name": "TestLastName",
    "Member_STATUS": "ACTIVE"
  },
  {
    "External_Contact_ID": "6506709",
    "Email_Address": "[email protected]",
    "First_Name": "Test_Name1",
    "Last_Name": "TestLastName1",
    "Member_STATUS": "ACTIVE"
  }
]

Can you please help me with JOLT specification ?

2

Answers


  1. You can use the below Jolt Spec.

    [
      {
        "operation": "shift",
        "spec": {
          "RootElement": {
            "*": "[]"
          }
        }
      }
    ]
    
    
    Login or Signup to reply.
  2. You can shortly apply the following shift transformation :

    [
      {
        "operation": "shift",
        "spec": {
          "*": "" // the asterisk stands for the "RootElement"
        }
      }
    ]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search