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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse Json to include ...
Power Automate
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" 

        ] 

    } 

} 

Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    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"]

  • hmenzel Profile Picture
    23 on at

    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" 

            ] 

        } 

    } 

  • Verified answer
    Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    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

    Ah, okay. Where would I add this exactly?

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Matthy79_0-1687409426618.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard