Skip to content

GetEnvironmentVariable

David Rivard edited this page Jan 22, 2022 · 6 revisions

GetEnvironmentVariable (driv_GetEnvironmentVariable)

This API is used to retrieve an Environment Variable value for a given key.

Environment Variables are a great feature, but the lack of a unified method to retrieve the values makes it somehow difficult to use. This API tries to simplify this process.

Parameters

Input Parameters

Parameter Type Description Required
Key String SchemaName of the Environment Variable definition X

Output Properties

Property Type Description
Exists Boolean Returns true if the value exists
ValueString String The string value of the environment variable. (Always populated)
ValueDecimal Decimal The decimal value of the environment variable if the Type is 'Decimal'
ValueBool Boolean The boolean value of the environment variable if the Type is 'Boolean'
ValueSecret String Resolved secret value from KeyVault
Type Picklist Returns the optionset value of the Environment Variable type. (String-100000000, Number-100000001, Boolean-100000002,JSON-100000003)
TypeName String Return the label of the Environment Variable type

Usage

WebApi:

Request https://{{baseurl}}/api/data/v9.1/driv_GetEnvironmentVariable

{
    "Key" : "{{SchemaName}}"
}

Response

{
    "@odata.context": "https://{{baseurl}}/api/data/v9.1/$metadata#Microsoft.Dynamics.CRM.driv_GetEnvironmentVariableResponse",
    "Exists": true,
    "ValueString": "yes",
    "ValueDecimal": null,
    "ValueBool": true,
    "Type": 100000002,
    "TypeName": "Boolean"
}

Power Automate:

unbound-action-trigger

GetEnvironmentVariable-Flow-Request

GetEnvironmentVariable-Flow-Response

v1.2022.01.62 : Added support for Secret Datatatype

Environment Variable of type Secret will be resolved from Keyvault in 'ValueSecret' response property

GetEnvironmentVariable_KV

Clone this wiki locally