How to handle null values in Power Automate Parse JSON

Introduction

While working with Power Automate, we often use the Parse JSON action to read data from APIs, SharePoint, or other connectors.
However, many developers face a common runtime error:

“Expected string value but got null.”

This error usually occurs when the incoming JSON contains null values, but the Parse JSON schema expects a string.

Prerequisites

Before going through this blog, you should have a basic understanding of the following concepts:

  • Familiarity with creating flows

  • Understanding of the Parse JSON action

  • Basic idea of JSON structure (key–value pairs)

Now let's understand Why This Error Happens

The Parse JSON action in Power Automate strictly validates the incoming data based on the schema provided.

If a field is defined in the schema as a string, Power Automate expects that field to always contain a string value.
However, in actual responses:

  • APIs may return null for optional fields

  • SharePoint columns may be empty

  • User-entered fields may not contain any value

Example

27-12-2025-04-51-21

As shown in the above image, the data is coming from a SharePoint HTTP action and is then passed to the Parse JSON action.
In this response, the GroupName field is defined as a string, but it returns a null value. Due to this mismatch, the Parse JSON action fails and throws the following error. You can apply this fix to any field - in my case, it is the GroupName field.

How to Fix This Issue

The error occurs because, in the Parse JSON schema, the GroupName field is defined strictly as a string:

"GroupName": {
  "type": "string"
}

To handle this scenario, we need to update the schema so that it accepts both string and null values.

Modify the GroupName field in the Parse JSON schema as shown below:

"GroupName": {
  "type": ["string", "null"]
}

Now, save the flow and run it again with null values; this time, it will not throw an error.

Note: If any other field shows the same error, just allow null for that field in the Parse JSON schema as well.

Conclusion

By following the steps above, you can easily handle null value errors in the Parse JSON action in Power Automate.