Just hit a wall with jmesPath, maybe someone has an idea how to solve that elegantly:
I’ve got this simplified JSON (from a webhook):
[
{
"body":{
"profile":{
"question_gx3xvn":{
"value":"Answer1",
"title":"Frage1?"
},
"question_bf5zj5":{
"value":"Answer2",
"title":"Frage2?"
},
"question_idna7x":{
"value":"Answer3",
"title":"Frage3?"
},
"question_u75yyy":{
"value":"Answer4",
"title":"Frage4?"
},
"question_wol4da":{
"value":"Answer15",
"title":"Frage5"
},
"name":{
"value":"John Doe",
"title":"Vor- & Nachname"
},
"email":{
"value":"[email protected]",
"title":"Deine E-Mail Adresse"
},
"phone":{
"value":"0043123456789",
"title":"Telefon"
}
}
}
}
]
The symbols in the question keys are random after “question_”.
I want one string field, where all questions with answers are combined in a human-readable format.
Something like that:
Question1: Answer1
Question2: Answer2
.
.
.
I thought about doing it with jmesPath in an expression in a Set node, as I already have a Set node there to clean up the data.
Here’s my last attempt, I only get an empty object with that.
{{ $jmespath($json.body.profile, "[?starts_with(@, 'question_')].json") }}
I would greatly appreciate any suggestions on how to accomplish this.