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! Go to 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")