Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Dynamics 365 Key Topics / Common Errors: Action ‘Init...

Common Errors: Action ‘Initialize_ variable failed’ in parsing JSON.

Devikumari Krishna Profile Picture Devikumari Krishna 371

In this blog we will address the common error we get while parsing JSON array in power automate. It is very common to get null values in the input files.

The first step is to create a trigger for flow. In this blog I have considered manual trigger.

We need to initialize the input variable. In our case it is Array. We can give sample values for our array as below,

The next step is to parse the JSON.

For the content we need to map the Array variable ‘ArrayParse’ that we initialized in the above step.

Click on Generate from sample. A sample JSON payload appears as below,

Click on Done.

The sample schema is generated as below,

{

    “type”: “array”,

    “items”: {

        “type”: “object”,

        “properties”: {

            “ProductName”: {

                “type”: “string”

            },

            “ProductID”: {

                “type”: “integer”

            }

        },

        “required”: [

            “ProductName”,

            “ProductID”

        ]

    }

}

Now test the flow.

We get the error Action ‘Initialize_variable’ failed,

Solution:

We need to remove the type generated by the sample schema manually,

Now the problem is resolved.

We could see the sample output successfully.


This was originally posted here.

Comments

*This post is locked for comments