Access nested variable in pre-request script #7833
-
Hey guys! I'm migrating from Postman to Insomnia and struggling to access nested variable in my pre-request script that does authorisation before every request.
What am I doing wrong? Is this possible? |
Beta Was this translation helpful? Give feedback.
Answered by
ihexxa
Aug 14, 2024
Replies: 1 comment 1 reply
-
Hey, const parent = insomnia.variables.get('parent'); // parent is an object
console.log(parent.property); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mr-nothing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
Hm I don't see a way to access nested value directly in Postman. In Insomnia, it intentionally provides a similar way for accessing values, additionally it is able to return an object instead of string, e.g: