Skip to main content
Question

Generate new JSON to send to API

  • March 13, 2026
  • 2 replies
  • 56 views

Bernaldo
Forum|alt.badge.img+2

Hi,

We need to transform the structure of an JSON array into another JSON array with different fields and structure using the 1st array values in order to POST it into an API.

In a playbook starting with a “Siemplify_Get Case Details” step, we retrieve all the entities from the case, using  [Siemplify_Get Case Details_1.JsonResult| "entityCards"], as far as we see is where the case entity fields are located, and has an structure like this:

 

"entityCards":[

    {
        "identifier":"XXXXXXXXXXX",
        "type":"HOSTNAME",
        "suspicious":false,
        "linkedEntities":[
        ]
    },
    {
        "identifier":"1.1.1.1",
        "type":"ADDRESS",
        "suspicious":false,
        "linkedEntities":[
        ]
    },
    {
        "identifier":"XXXXXXX",
        "type":"HOSTNAME",
        "suspicious":false,
        "linkedEntities":[
            {
                "identifier":"2.2.2.2",
                "type":"ADDRESS",
                "suspicious":false,
                "linkedEntities":[
                ],
                "direction":20
            }
        ]
    },

How we can transform that JSON array in another JSON array with different structure, something like:

 

[{

"dataType_1": "identifier1",

"data_1": [],

"message": "string"

},

{

"dataType_2": "identifier2",

"data_2": [],

"message": "string"

}

]

 

Basically it’s a matter of format in order to POST it into an API.

 

Best regards

2 replies

kentphelps
Community Manager
Forum|alt.badge.img+12
  • Community Manager
  • April 3, 2026

These are a bit dated so the screenshots have changed but you should be able to find some help here:


James_E
Staff
Forum|alt.badge.img+8
  • Staff
  • April 6, 2026

I agree with ​@kentphelps. You’ll want to use Jinja to create the new JSON array.