web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to handle "null" v...
Power Automate
Unanswered

How to handle "null" value in JSON when developing the Custom Connector of the Power Platform and Automate?

(0) ShareShare
ReportReport
Posted on by 2

I'm developing the Custom Connector and the Automate on the Power Platform.

Let's say that:

  • The Automate flow receive JSON via the custom connector

  • The JSON response data has over hundreds of properties

  • The JSON may have "null" value on some of properties, and they cannot be predictable what property have the null value

  • According to that reason, I have to handle the null value with the Custom Connector

To avoid error, what kind of method can I have with developing the connector?

 

FYI: I found the Microsoft's document, but the below way cannot be used because of the reason I wrote above.

https://support.microsoft.com/en-us/topic/getting-errors-with-null-fields-d0a36825-72eb-bd78-dcc0-26018e8a1986

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @TakeshiOsanai 

     

    There's another way to enable null values. In the JSON definition you should have something like this:

    {
     "type": "object",
     "properties": {
     "days": {
     "type": "integer"
     }
     }
    }

     

    In the example above we're indicating that "days" is a integer and only an integer. If it's something else it will fail. Since null is not an integer you get an error every time there's a null value.

     

    To fix it you need to define that the value can receive 2 types. The actual type (string, integer, etc) and null. So you can do something like this:

    {
     "type": "object",
     "properties": {
     "days": {
     "type": [
     "integer",
     "null"
     ]
     }
     }
    }

     

    Do this for all the types that you know that a null value is possible. Don't forget, in the Flow, to deal with the null values so not to save invalid values.

     

    Now the type can be 2 things and not only one.

     

    Does this make sense?

     

    Can you please check if and let me know if you have any questions?

     

    Cheers
    Manuel

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • TakeshiOsanai Profile Picture
    2 on at

    Hi @manuelstgomes.

    Thank you for your quick response, and sorry for my late reply.

     

    Let me ask you more in detail.

    Is this solution the official way to solve the null problem and written in Microsoft's documentation?

    Or is this an unofficial workaround?

     

    The reasons of my asking are:

    * I want to make the connector  certified by Microsoft and reveal it to the connector's page
    https://flow.microsoft.com/en-US/connectors/
     

    * I am wondering that Microsoft suddenly change the specification of the Automate and this workaround will be invalitated or not.

    This may be the needless worry, but want to clear.

    Thanks in advance!

  • manuelstgomes Profile Picture
    6,625 on at

    HI @TakeshiOsanai 

     

    Great question. This is how JSON schemas work so it's not a workaround.

    https://json-schema.org/understanding-json-schema/reference/null.html

     

    Good luck with the submission.

     

    Cheers
    Manuel

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

  • rvroman Profile Picture
    29 on at

    Manuel - 

    Can you describe/show how this would be defined in the Custom Connector? When trying to implement your solution I get an error message about null not being a supported type in the Swagger Editor:

     

    should be equal to one of the allowed values allowedValues: array, boolean, integer, number, object, string

  • SDRobert Profile Picture
    2 on at

    I'd love to know the answer for this myself.

    Also looking to make an actual custom connector the has to handle possible null values in response body from the GET.

    Be nice to at least find a "this is not supported" message but cannot find that spelled out yet either.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard