Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Parse Json to include Null?

(0) ShareShare
ReportReport
Posted on by 23

How can I edit this parse Json to allow "null" items? The flow needs to proceed both with or without a file attachment. 

 

{ 

    "type": "array", 

    "items": { 

        "type": "object", 

        "properties": { 

            "name": { 

                "type": "string" 

            }, 

            "link": { 

                "type": "string" 

            }, 

            "id": { 

                "type": "string" 

            }, 

            "type": {}, 

            "size": { 

                "type": "integer" 

            }, 

            "referenceId": { 

                "type": "string" 

            }, 

            "driveId": { 

                "type": "string" 

            }, 

            "status": { 

                "type": "integer" 

            }, 

            "uploadSessionUrl": {} 

        }, 

        "required": [ 

            "name", 

            "link", 

            "id", 

            "type", 

            "size", 

            "referenceId", 

            "driveId", 

            "status", 

            "uploadSessionUrl" 

        ] 

    } 

} 

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Parse Json to include Null?

    Matthy79_0-1687409426618.png

     

  • hmenzel Profile Picture
    23 on at
    Re: Parse Json to include Null?

    Ah, okay. Where would I add this exactly?

  • Verified answer
    Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Parse Json to include Null?

    Ok, now I think I got it. You don't need the change the schema. The content is the problem. You could use this function in the content to solve the problem.

     

    coalesce(null, json('[]'))

     

    Instead of null you have to put in whatever is currently in the content field.

  • hmenzel Profile Picture
    23 on at
    Re: Parse Json to include Null?

    Thanks for the suggestion. I added those (see below), but it still produced an error "Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'." Any other ideas?

     

    { 

        "type""array", 

        "items": { 

            "type""object", 

            "properties": { 

                "name": { 

                    "type": [ 

                        "string", 

                        "null" 

                    ] 

                }, 

                "link": { 

                    "type": [ 

                        "string", 

                        "null" 

                    ] 

                }, 

                "id": { 

                    "type": [ 

                        "string", 

                        "null" 

                    ] 

                }, 

                "type": {}, 

                "size": { 

                    "type""integer" 

                }, 

                "referenceId": { 

                    "type""string" 

                }, 

                "driveId": { 

                    "type""string" 

                }, 

                "status": { 

                    "type""integer" 

                }, 

                "uploadSessionUrl": {} 

            }, 

            "required": [ 

                "name", 

                "link", 

                "id", 

                "type", 

                "size", 

                "referenceId", 

                "driveId", 

                "status", 

                "uploadSessionUrl" 

            ] 

        } 

    } 

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Parse Json to include Null?

    Not sure if I understood the question correct but you can change the type to an array and add the possibility to allow null.

     

    change the type from

     

    "type": "string"

    to

     

    "type": ["string", "null"]

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1