cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ishraqiyun77
Helper IV
Helper IV

Allow null value in child "When a HTTP request is received"

In the past when I've had to parse JSON, or construct a schema, and I need to allow for "null", this has always worked for me in Power Automate:

 

{
    "type": "object",
    "properties": {
        "accountId": {
            "type": "string"
        },
        "industryTags": {
            "type": [
                "string",
                "null"
            ]
        }
    }
}

 

This is also confirmed here: https://stackoverflow.com/a/56708378/3123109.

Now I'm trying to work on a child flow and need it to receive null values and it isn't working. The field doesn't show up in the parent child request:

Screenshot from 2020-05-16 15-11-40.png

If I change it to "type": "string", then it does show up. But then inevitably some data is sent over without industryTags and it fails.

So how do I allow for null values in this use case?

6 REPLIES 6
abm
Super User
Super User

Hi @ishraqiyun77 

 

Are you passing the null as expression?

 

image.png

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

No, I am just passing the value of the field from Dynamics 365. So if the field value is empty, it just passes it null.

Hi @ishraqiyun77 

 

Thanks for your quick reply. What's the error you getting? Make sure the child flow input is not mandatory.

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

That is one thing I was trying to figure out how to do was not make it mandatory. How do you do that in the JSON scheme declaration?

 

I don't have the error in front of me anymore, but it was something along the lines of: "Was expecting a string/integer, but received 'Null'."

Hi @ishraqiyun77 

 

The JSON scheme declaration you described earlier is correct other than you haven't specified the null optional set for accountId. Believe this was a typo and you already taken care of it in your flow.

 

{
    "type": "object",
    "properties": {
        "accountId": {
            "type": "string"
        },
        "industryTags": {
            "type": [
                "string",
                "null"
            ]
        }
    }
}

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@ishraqiyun77 

 

Where (or how) you use the "industryTags" in your child?

I try to reproduce by following parent and child flow. the result is if "industryTags" pass to child is null, then "industryTags" is not included in the http request (not sent over), if has some value then it will be included in request.

 

parent.png

child.png

 

 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Users online (2,118)