Forum Discussion
I’ve tried the same as I showed you in response above, only thing that I’ve changed was that I was using fields that you provided in the post and I couldn’t work them out anyhow.
I’ve also tried with apache velocity but nothing.
Problem are those “:” you have in the name. I don’t know why but you can not map fields in JSON Generator with square brackets.
Solution could be as you said to map the first in mapper and pass it to JSON Generator with null-safe-access, or with expression to remove those “:” from the name of the field.
Hi @viktor_n,
I’m now pretty certain that expressions don’t work in the JSON Generator snap at all (regardless of square brackets or colons). Posting to see if anyone can confirm, but I think the snap only takes pure JSON and a direct variable reference. It’s just a shame that it’s not null safe, so it requires another mapper snap before it.
The basic pipeline below highlights the issue, that no expressions, like “$.get()” are allowed in the snap.
JSON Generator Expression Test_2021_12_06.slp (4.7 KB)
Thanks,
Charles
- khanh_tran5 years agoNew Contributor III
yes, sure. that’s all I want. Because every object will be not duplicated except the key-participant_survey_progress_sk. The field is also group by key, so it’s also not problem.