cancel
Showing results for 
Search instead for 
Did you mean: 
DeviKrishna

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

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,

  

DeviKrishna_3-1674031191661.png

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.

DeviKrishna_4-1674031262574.png

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

Click on Done.

DeviKrishna_5-1674031316014.png

The sample schema is generated as below,

 

{
    “type”: “array”,

    “items”: {

        “type”: “object”,

        “properties”: {

            “ProductName”: {

                “type”: “string”

            },

            “ProductID”: {

                “type”: “integer”

            }

        },

        “required”: [

            “ProductName”,

            “ProductID”

        ]

    }

}

DeviKrishna_6-1674031573790.png

Now test the flow.

We get the error Action ‘Initialize_variable’ failed,

DeviKrishna_7-1674031630401.png

Solution:

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

DeviKrishna_8-1674031680570.png

Now the problem is resolved.

We could see the sample output successfully.

DeviKrishna_10-1674031732994.png