Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

No attachment causes error in flow

(0) ShareShare
ReportReport
Posted on by 11

Hi folks,

 

I've successfully figured out how to add an attachment from an MS Form into a Sharepoint list. It works like a charm thanks to the good people in this community (thank you!).

 

My issue now (ironically) is that when my MS Form submission doesn't have an attachment, the flow fails at the Parse JSON step with the following error:

 

InvalidTemplate. 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 ''.'.

 

I think this means that it's expecting to find content, but there's no attachment. Is this as simple as just adding a condition to check if there is no attachment? Any suggestions?

 

Here's the Parse JSON code:

 

{
    "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"
        ]
    }
}
 
01.jpg02.jpg03.jpg
  • steveyhandsome Profile Picture
    11 on at
    Re: No attachment causes error in flow

    Thanks @v-liwei-msft! Now I'm getting an error with that expression. Does this code make sense in the Empty expression, or do I need to input the string of characters from your screenshot?

    empty(outputs('Get response details')?['body'])
     
    Apologies for all the questions, Power Automate is not my forte.
  • Verified answer
    v-liwei-msft Profile Picture
    on at
    Re: No attachment causes error in flow

    Hi @steveyhandsome 

     

    You can add a condition and use the empty function to check if the attachment is empty:

    vliweimsft_0-1669343353419.png

    vliweimsft_1-1669343365375.png

     

    Best Regards,

    Levi

     

  • steveyhandsome Profile Picture
    11 on at
    Re: No attachment causes error in flow

    Hey @Jcook 

     

    The name of the field (from the MS Form) is Supporting documentation. 

     

    Here's what the screenshot looks like:

    04.jpg

     

    Do I really need to delete all the 'Required' properties?

  • Jcook Profile Picture
    7,779 Most Valuable Professional on at
    Re: No attachment causes error in flow

    Hi @steveyhandsome 

     

    What is the name of the attachment field?

     

    You can remove the "required" properties from the JSON schema (It's at the end in [ ] )

     

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