cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Flow failed if no attachment in Microsoft Forms

Hi, 

I have created a Microsoft Forms with Upload File attachment and then added the actions of "When a new response is submitted" -> "Get response details"-> "Parse JASON" -> "Get File content using path" -> "Send and email" to include the attachment or as a link in an email. However, I found that if there is no attachment in the Forms, the flow would be failed.  

 

Can I have some advices on how to fix this issue? Is there a condition action that I have to add? Thanks. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

hi @Positano1  please follow this steps to add a condition if the form response don't have attachments.

Flow3.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

19 REPLIES 19
Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

hi @Positano1  could you please send an screanshot from your get response details output? Please see if in the section ParseJson you have a propertie call Link.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

 

Hi @ChristianAbata 

I just modified the flow a little bit as a I want to have the attachment link in the "Create a Work Item" which is to create a work item in DevOps.

Here is the screen shot:

Flow.PNG

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

 
Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

oh @Positano1  you are getting a null value in content propertie. Please flow this example to allow null values.

 

"content": {
"type": ["number","null"]
}



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbata Sorry I'm not good at coding but is the below correct after adding your suggested 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": {}
         },
         "content": {
             "type": [
                "number",
                "null"
            ]
         },
        "required": [
            "name",
            "link",
            "id",
            "type",
            "size",
            "referenceId",
            "driveId",
            "status",
            "uploadSessionUrl"
        ]
    }
}
Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

@Positano1  yes..



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbataJust tried but still getting the same error message...any idea?

 

Flow1.PNG

 

Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

@Positano1  could you try by leaving the value empty

 

{
    "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": {}
         },
         "content": {
           
         },
        "required": [
            "name",
            "link",
            "id",
            "type",
            "size",
            "referenceId",
            "driveId",
            "status",
            "uploadSessionUrl"
        ]
    }
}


Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbataTried again but still not working...😣

Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbataBtw, do you have any idea to attach an attachment to DevOps ? I'm actually creating a feature in DevOps once the form is submitted with attachment. However, the work item can be created in DevOps but no attachment.

Now I only put the attachment as a link in the Description box in the work item as a alternative solution.

Thanks so much for your advice. 

Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

mm @Positano1  we need the link becouse as you have, you need to upload the image to get the content file and then adding as attachment.

 

Please try by following this example.

getformsImage.gif



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbataAppreciate your flow guidance. Since I only have one field "Attachments" in the form, can you advise if my flow setting is correct? Flow.PNG

 

Flow1.PNG

 

And using the schema with empty content 

 "content": {},
Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

yes @Positano1  but if you want to use the value in compose into get file content (One Drive) you need to drag the action inside apply to each is the same for devops action.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbataJust tried, if I don't have any attachment in the form, the flow failed. Did I miss anything in the flow setting? 

 

Flow2.PNG

 

Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

Hi @Positano1

Can you try:
In your JSON schema, change:
"content": {
"type": [
"number",
"null"
]
},

To:
"content": {
},




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





Highlighted
Community Support
Community Support

Re: Flow failed if no attachment in Microsoft Forms

 

Hi @Positano1 ,

 

Please check the same thread and see if it helps:

https://powerusers.microsoft.com/t5/Building-Flows/Flow-failed-if-no-attachment-in-Microsoft-Forms/m...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

hi @Positano1  please follow this steps to add a condition if the form response don't have attachments.

Flow3.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Highlighted
Helper I
Helper I

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbataThanks a lot. It works perfectly. 

Highlighted
Frequent Visitor

Re: Flow failed if no attachment in Microsoft Forms

@ChristianAbata @Positano1  I have similar requirement to create an attachment in ADO when Microsoft Form is submitted. I guess there is no direct attachment option available. Is there any way we could do this.  I tried using "Send an HTTP request  to Azure Devops" but is throwing an error.I believe the parameters what is provided is wrong.  Could you please help me getting the correct logic for attachment.Ado attachment flow.JPGADO attchement errorJPG.JPG

This is a project requirement and need some quick assistance. Appreciate your support. Thanks in advance.

 

Regards,

Bharat

Highlighted
Super User
Super User

Re: Flow failed if no attachment in Microsoft Forms

@Bharat_CV 

 

Please create a new post. That way all users and Super Users, will be able to find and help you.

 

Thanks





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,068)