Jsonata: return value from context array

Hi @psmtvdw

you cannot use a JSONata expression as the key passed to the flowContext function.

You would have to get the full object from context and then use a JSONata expression to pull out the piece you want:

$flowContext('Products').Products[ProductID=$$.topic].ProductName

This assumes the product ID you want to lookup is in msg.topic and that it is a number type - not a String. JSONata is strict about types.

For future reference, please read this post about sharing code/flows in the forum: How to share code or flow json