cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Positano1
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

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

20 REPLIES 20
ChristianAbata
Super User II
Super User II

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

 

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

 

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

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

@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

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

 

Flow1.PNG

 

@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

@ChristianAbataTried again but still not working...😣

@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. 

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

@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": {},

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

@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

 

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!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





 

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.

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

@ChristianAbataThanks a lot. It works perfectly. 

@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

@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!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (15,651)