Using environment variables in custom code #3566
-
I am working on a custom connector that uses custom code to execute the actions. This connector is in a Power Platform solution that has several defined Environment Variables. Is it possible to use those environment variables in the custom code? I've explored the Environment class, but that does not seem to be correct. It seems like it might be in the Context object, but I just can't find it. Thanks for any help provided, even if it's to say "stop wasting your time!" |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
You can set the default of a query or header parameter to the environment var and then get that parameter using custom code. That’s the only way I know to do it |
Beta Was this translation helpful? Give feedback.
-
Try default: '@environmentVariables('new_test')' |
Beta Was this translation helpful? Give feedback.
-
Are you sure the connector is in a solution? |
Beta Was this translation helpful? Give feedback.
-
Rather than as default on the parameter, try setting it with a policy. It should be like this, even though this uses a connection parameter: |
Beta Was this translation helpful? Give feedback.
Rather than as default on the parameter, try setting it with a policy. It should be like this, even though this uses a connection parameter: