I have a node where I need to unroll the data object and post this as a body:
{"id": 123, "name": "example","value": 456}
The contents of data object are dynamic, so I can’t reference the individual fields. The natural solution would seem to be using the object spread operator in an expression, but that gives me a syntax error:
After some experimenting I’ve found this is possible using a jmespath merge expression, but it’s pretty clunky and hard to read so if anyone has a better solution I’m listening!
{{ $jmespath($(‘Is record valid?’).item.json,“merge({id:id},data)”) }}