variable substitution in the base url of a REST call

stevebrownell
Mega Expert

I've seen multiple tutorials that discuss using variable substitution in the resource path as shown in this screen shot.

stevebrownell_0-1741782814053.png

Can I use the same variable substitution in the base url?

 

Why do I want this?... For the same reasons that we get dev, test, and prod environments for ServiceNow, I also have multiple environments for other vendor products.  In the example shown above that would "rebrickable.com".  Imagine that I also have a dev and test environment for rebrickable with base urls "rebrickable-dev.com" and "rebrickable-test.com".  I want to be able to substitute the base url so that my ServiceNow dev environment make the rest call to the rebrickable dev environment and so on.

 

I'm concerned that if the base url has to be hard-coded that I'm going to have problems publishing my application to the different environments.

1 ACCEPTED SOLUTION

stevebrownell
Mega Expert

Well, I found the answer to my newbie question.  The example I showed was for an inline connection.  If I separate the connection from the setup, then I can have separate connection definitions in each environment, which is what I was looking to do.

View solution in original post

1 REPLY 1

stevebrownell
Mega Expert

Well, I found the answer to my newbie question.  The example I showed was for an inline connection.  If I separate the connection from the setup, then I can have separate connection definitions in each environment, which is what I was looking to do.