Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Using Javascript Extraction with Environment Config variables

rich
New Member

Adding the Extract Variables and Javascript policy with the Target pre flow has works for changing the target url

context.setVariable("target.url",targetURL);

But, instead of the target URL, I will need to use a Environmental Variable for the base of my target servers (dev/test/prod)

How can I reference the Environmental Variable for a Target Server in the js resource context?

Solved Solved
0 6 741
1 ACCEPTED SOLUTION

What exactly do you mean by environment variable in the context of the api proxy?

You have two options:

1. Use target servers and you can define it separately for each environment

2. Use key value maps with environment scope, fetch the values from the KVM into a flow variable using the KVM operations policy. In the JS you can then access the variable in the usual format context.getVariable("prefix.varname")

View solution in original post

6 REPLIES 6
Top Solution Authors