How To Refer to JSON Properties of Collection Variable within a Request Body

Hi there!

In order to save on the number of variables saved in my Collection, we thought of saving them as a JSON within a collection variable.

Simplified example,

I have “configTest” which is a collection variable defined as:

{
id: 0,
key: "UniqueKey",
}

I want to use the value of the key property within the body of a request.

Obviously things like {{configTest.key}} don’t work. Is my only option to extract the value of the key property, and save it within a temporary collectionVariable?

Or is there a way to point directly towards that value within the JSON of the collection variable without having to pass it on to this temporary collection variable I’m considering of using. (Seems like my only option)

Any feedback/tips would be welcomed!

Thanks!

You can’t use nested properties using the {{someVar}} syntax.
You need to transform them in other Postman variables in the pre-request script before using them.