Nested Variables to use in all types of variables, how? key: FQDN value: {{host}}.{{domain}}

I’m trying to build a collection with many different folders and trying to make use of global and environment variables in order to use them in many places and run the collection for a few different environments.

But I fail to understand and fail to use variables that use variables themselves as values, e.g.

name = abc
first name = pete
host = machine1
domain = dot.com

And then I want to use as the URL for the get a variable that is combined, e.g.

https://{{FQDN}}/

which I would like to define in global environment variables as:

FQDN = {{host}}.{{domain}}

How to do this?

You could add the following to the Pre-Request Script of your first request, or even build out a “Setup” folder as the first thing to execute.

You’ll need to set this programmatically as the environment editor takes plain text only.

const host = pm.environment.get("host");
const domain = pm.environment.get("domain");
pm.environment.set("fqdn", `${host}.${domain}`);