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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / MS Form Submitted with...
Power Automate
Answered

MS Form Submitted without attachments

(0) ShareShare
ReportReport
Posted on by 10
Hi,
 
I have a flow that stores responses from an MS Form in a SharePoint List.

The first question in the Form allows the responder to attach files. I currently use a Parse JSON step (found online) which enables me to add attachments to the List item in a For Each loop that references outputs('Parse_JSON')['body'].
 
The flow fails at the Parse JSON stage when no attachments are included.

Is there a practical work around for this?

Parse JSON step code below for reference.
 
Thanks for reading
Matt
{
  "type": "ParseJson",
  "inputs": {
    "content": "@body('Get_response_details')?['r52970a37d7f44534842ce10180188f96']",
    "schema": {
      "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"
        ]
      }
    }
  },
  "runAfter": {
    "Condition": [
      "SUCCEEDED"
    ]
  }
}
 
Categories:
  • Suggested answer
    David_MA Profile Picture
    15,589 Super User 2026 Season 2 on at
    To check if there are attachments with an attachment question in MS Forms, add a condition and use a length expression to calculate the number of attachments:
     
    The expression is length(outputs('Get_response_details')?['body/your-attachment-question'])
     
    If it returns greater than 0, on the yes side of the condition do whatever you are doing. 
  • Verified answer
    Mark Nanneman Profile Picture
    993 Moderator on at
    If you don't need the items that have no attachments, you could filter them out, or use a condition to check the '{HasAttachments}' property.

    Another option is you could add the "null" type to the list of accepted types for your properties in your ParseJSON schema.   

    Whenever you use the "ParseJSON" and you generate the schema from sample data, it will fail if it ever gets a null value for a property (that wasn't null in the sample data).  A work around is to find the "type": setting for any properties that might be null, and change the value to an array that includes the original type and "null".
     
    "name": {
                "type": "string"
              }
    
    //will fail if "name" is ever missing or null
    
    
    "name": {
                "type": ["string","null"]
              }
    //will work if "name" is ever missing or null.
    Generally though I find that "ParseJSON" is more trouble than it's worth in most cases.  It's best to just get a sample JSON body and keep it open in NotePad or something in another window for reference.  Then you can use expressions to refernce whatever property you want from your data output.  Usining a "?" will cause it to accept nulls if the property is missing from the data on the current run.

    outputs('Compose_Object_to_Parse')?['propertyYouWant']

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard