Repository navigation
Using environment variables in custom code #3566
Answered
by
troystaylor
Don Kirkham (DonKirkham)
asked this question in
Q&A
|
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!" |
Answered by
troystaylor
Jul 18, 2024
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 |
2 replies
|
Try default: '@environmentVariables('new_test')' |
1 reply
|
Are you sure the connector is in a solution? |
1 reply
Answer selected by
DonKirkham
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




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: