Hi there,
is it possible to get the Mutate node to get a Key via a variable?
Something like this (not working):
Hi there,
is it possible to get the Mutate node to get a Key via a variable?
Something like this (not working):
In a payload path, no, there is no way to insert a variable into the path. But what you can do is use the {{lookup}}
helper to reference a value at a variable path in a template.
So, change your “Move a value” operation to a “Set a new value” operation:
{{lookup (lookup working.query.result.devices working.device.deviceId) 'points'}}
working.points
Hi Dylan, think I have a similar problem as this but am having some trouble and all I seem to get back is :
Here is my mutate node:
Corresponding payload structure:
Looks like it is finding the right place but doesn’t like creating an array or points at the destination path.
Yup, since the value you’re looking up there is an object, you need to do two additional things:
{{jsonEncode}}
helper like below to retrieve the objects instead of the string “[object Object]”.data.points
will be a stringified result.{{jsonEncode (lookup (lookup data.currentTrip.trip_data.result.devices data.params.asset_id) 'points')}}
Thanks @Dylan_Schuster worked perfectly