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 / No attachment causes e...
Power Automate
Unanswered

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
Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    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 [ ] )

     

  • steveyhandsome Profile Picture
    11 on at

    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?

  • Verified answer
    v-liwei-msft Profile Picture
    on at

    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

    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.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard