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:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    14,520 Super User 2026 Season 1 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 809

#3
Haque Profile Picture

Haque 645

Last 30 days Overall leaderboard