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

Community site session details

Session Id : laZy0O5K4YE0AFgyUud1u7
Power Automate - Building Flows
Answered

Verify if a Microsoft Form has an attachment

Like (1) ShareShare
ReportReport
Posted on 1 Jan 2020 22:09:25 by

I need to verify if a Microsoft Form was submitted with an attachment.

 

Here is the attachment option on my Microsoft Form

form.jpg

Here is how I have my Flow setup

flow2.jpg

 

Regardless of whether I have an attachment or not, I'm still getting "expression result = false".  I'd expect to get a TRUE or FALSE depending on whether I had an attachment on the Form or not.

 

results.jpg

 

  • QuintonR Profile Picture
    28 on 08 Sep 2023 at 18:57:43
    Re: Verify if a Microsoft Form has an attachment

    Here is an example of how to write a condition to check if a Microsoft Form response contains an attachment.

     

    Step 1: Add the trigger "When a new response is submitted" and select your form.

    QuintonR_9-1694200192786.png

     

    Step 2: Get response details. In the Response Id, select "Response Id." 

    QuintonR_10-1694200192785.png


    Step 3: Create a new Control and select Condition.

    QuintonR_11-1694200192788.png

     

    Step 4: In the box on the left, select Dynamic Content, then choose your question where users submit a file. In this example, the question is "Attach File (If applicable)."

    QuintonR_12-1694200192782.png

     

    Step 5: Select "contains" in the middle box.

    QuintonR_13-1694200192784.png

     

    Step 6: In the box on the right-hand side, type a single opening bracket (Don't include quotation marks) 

    QuintonR_14-1694200192977.png

     

    Step 7: Add whatever actions you want in the "If yes" and "If no" fields. 

    QuintonR_15-1694200192785.png


    Here is why this works:

    If your question asks the user to upload a file, and the user doesn't upload a file, the raw output looks like this:

    QuintonR_16-1694200193025.png

     

    If your question asks the user to upload a file, and the user does upload a file, the raw output looks like this:

    QuintonR_17-1694200192787.png

     

    In this example, the "[" character appears only when the user submits an attachment. Therefore, if there's no "[" character, there's no attachment. If there is a "[" character, there's an attachment.

     

    Final Notes

    It's important to note that I don't have Microsoft Documentation to back up this theory. It's just something I've discovered, tested, and used on my end. It works reliably for me, but whether or not this example follows best practice, I can't say. 

  • afshan Profile Picture
    5 on 23 May 2022 at 02:24:03
    Re: Verify if a Microsoft Form has an attachment

    Thanks, this has helped me as well, since the attachment question in my form is optional 

  • mambo Profile Picture
    3 on 15 Oct 2021 at 06:00:52
    Re: Verify if a Microsoft Form has an attachment

    Thank you, @Nicolas07 . I had the same error and this worked for me.

  • Nicolas07 Profile Picture
    42 on 23 Jun 2021 at 15:00:22
    Re: Verify if a Microsoft Form has an attachment

    So I solved my own problem 🙂

    I changed my condition to simply check if the Forms question where documents can be uploaded is not equal to null. To do so I have simply left the field empty. See below.

    Screenshot 2021-06-23 at 16.59.48.png

  • Nicolas07 Profile Picture
    42 on 23 Jun 2021 at 10:26:06
    Re: Verify if a Microsoft Form has an attachment

    Hi @abm ,

    I am trying to do the same thing, but I am getting the following error on the condition: 

     

    Unable to process template language expressions for action 'Condition' at line '1' and column '27420': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#length for usage details.'.

     

     

    This is how my flow looks like.

    Screenshot 2021-06-23 at 12.25.21.png

    It copies responses submitted in a Form into a Sharepoint list. I want it to copy also the attachments (i'm using a parse JSON) in the Sharepoint list too. But if there are no attachments, the Parse JSON fails. So I would like to have the condition to check first if there are any attachments. If yes --> Parse JSON. If not, go to the next step (send email from shared mailbox).

     

    Thanks for your help!!

  • jmillar99 Profile Picture
    23 on 03 Jun 2021 at 00:13:27
    Re: Verify if a Microsoft Form has an attachment

    Thank you for the time you spend to help people with these questions.  Your response helped me as well.

  • Community Power Platform Member Profile Picture
    on 15 Apr 2021 at 15:11:04
    Re: Verify if a Microsoft Form has an attachment

    This helped me fixed my problem also.
    Thanks a lot

  • Community Power Platform Member Profile Picture
    on 02 Jan 2020 at 01:11:44
    Re: Verify if a Microsoft Form has an attachment

    @abm This is exactly what I was missing.  Thank you so much and Happy New Year :)!

  • v-alzhan-msft Profile Picture
    on 02 Jan 2020 at 01:04:40
    Re: Verify if a Microsoft Form has an attachment

    Hi @Anonymous ,

     

    Please take a try with @abm 's solution and let me know if you have any problem s.

     

    Best regards,

    Alice       

     

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

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 02 Jan 2020 at 00:32:28
    Re: Verify if a Microsoft Form has an attachment

    Hi @Anonymous 

     

    Yes you can add the output in the condition greater than 0 (Zero). 

    image.png

     

    Or without the compose you can add the expression under the IF statement. See below.

     

    image.png

     

    Both should work.

     

    Thanks

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete