Hi! I’m having a little problem with a JSON that i’m receiving from a form in my workflow, the JSON is:
{
"origem":"Facebook",
"empreendimento":[
{
"id":"11",
"nome":"AGL 24 - Park Club Cidade Jardim"
}
],
"campos_adicionais":[
{
"slug":"cf_em_qual_cidade_voce_quer_o_seu_ape",
"valor":"Águas Lindas - GO"
},
{
"slug":"SDR",
"valor":"Alef"
}
]
}
I need to filter de JSON and take the value of “slug”:“SDR” in “Campos_adicionais”, but since I got more then one “slug” key, I cant filter with the following sintax: {{$json[“body”][“campos_adcionais”][“slug”]}}.
Does anyone know how can I filter by the value instead the key? I don’t know if it’s possible, so if anyone has another solution it will be really helpful.
Hi, I’m trying to apply this solution. It works when I test it as @RicardoE105 suggested, but when I want to substitute the test json with the json resulting from a previous node, I can’t get it to work.
I tried
Hey @cdesseaux,
As the error message suggests, all the items should be wrapped within a JSON object. In your return statement, you need to have something similar to this return {json: item}. This code snippet will wrap each item into a JSON object. If you’re interested to learn more you should check out