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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (4,606)