cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
larschrjensen
Helper I
Helper I

Pre-populate environment variables with comples types

I was very happy to see the ability to prepopulate connection references and enviroment variables in the build tools for Azure Devops (as described here https://docs.microsoft.com/en-us/power-platform/alm/conn-ref-env-variables-build-tools). For me this works great with simple string-based values, but can this method also be used to prepopulate environment variables with more complex type such as JSON. I can't seem to get a grip on how to accomplish this.

 

Any with any experiences?

 

{
  "EnvironmentVariables": [
    {
      "SchemaName": "tst_Deployment_env",
      "Value": ""
    }
}

 

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @larschrjensen :

The format of the JSON string you provided looks wrong:

 

{
"EnvironmentVariables": [
{
"SchemaName": "tst_Deployment_env",
"Value": ""
} ]
}

 

Best Regards,

Bof

lbolbot
New Member

Hello @larschrjensen 

 

I encountered the same issue. For me, treating JSONs as strings with escaped double quotes worked.

Example

{
  "EnvironmentVariables": [
    {
      "SchemaName": "tst_samplejson",
      "Value": "{\"prop1\":\"val1\",\"prop2\":{\"subprop1\":\"val2\"}}"
    }
  ]
}

 

You won't have those backslashes in variable value after solution import.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Users online (3,019)