Skip to main content

Hi

I have a Zap that produces output that looks like:
 

{
"id":123,
"name":"Joe",
"items":
{
"id":"ABC",
"type":"type1"
},
{
"id":"XYZ",
"type":"type2"
},
{
"id":"BEY",
"type":"type1"
}
]
}

 

I want to specifically filter the items array to only include items of a specific type. I want the output to include all other fields, in this case the output for filtering on `type1` should be:

 

{
"id":123,
"name":"Joe",
"items": "
{
"id":"ABC",
"type":"type1"
},
{
"id":"BEY",
"type":"type1"
}
]
}

 

Is there an easy way to accomplish this?

Hi @gzcal 

Good question.

Help articles:

 


Thanks @Troy Tessalone 

I don't think either of those work in this case - my main problem is I want to keep all the other fields from the input. I just want to filter out object with a specific type in the items subfield


@gzcal 

Try asking ChatGPT for help with the JavaScript/Python Code to filter the JSON.