A problem with the map function

:bullseye: What is your goal?

Retrieve a data from a json using map function

:thinking: What is the problem & what have you tried?

The problem is that the map function works for some questions and doesn’t work for anothers questions

If you can take a look at my concern please : sorry for my bad english Zight Recording 2025-11-25 ...

:clipboard: Error messages or input/output bundles

The output is empty but should return the content of answer

In Make, map() only returns values when the field you point to actually exists in each array item. If some answers have a different key or nesting, those elements come back empty. Compare the JSON of a ‘working’ and ‘non-working’ question in your output bundles and adjust the path in map() to match the real structure.

1 Like

Thanks a lot for your back but if you take a look at my concern, I think I do it the right way may be I’m wrong ?

The concerning answer is not empty.

Or if it’s possible you can test the json on your end please.

Here is the concerning question “As tu compris tout le contenu, caractéristiques et modalités pour rejoindre l’accompagnement de la Méthode Pamplemousse avec moi ?“ I want to retrieve the answer

test.json (4.2 KB)

Try copy/pasting the question directly from the webhook to make sure it matches.

Also, if the questions are static and always in the same place, you can use the orderindex to get the answers directly, no need to use map().

And lastly, wrap the map() function in a first() function to get the answer directly, instead of getting an array with one item inside.

1 Like

Thanks for your back, yes the texts matches that’s what is worriet me a little.

I use this {{get(1.payload.questions_and_answers; “5.answer”)}} and it fixed my issue.

2 Likes