Get JSONObject with a key in variable

Hi Everyone,

May I is there a way to get an object/value from a JSONObject like this

{{ result[’ {{ keyName }} '] }}

For example:

result:
{ “key1”: “value1”, “key2”: “value2” }

keyName: “key1”

Then the response for {{ result[’ {{ keyName }} '] }} should be “value1”

Thanks

{{ result[keyName] }}

Here are some samples, expanding on Kai Stian Olstad’s response: