web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
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

 

I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,585 Most Valuable Professional on 01 Jan 2020 at 23:15:40
    Re: Verify if a Microsoft Form has an attachment

    Hi @Anonymous 

     

    Happy New Year

     

    Check the length of the attachment response using expression.

     

    image.png

    The above expression is as follows:
    length(body('Get_response_details')?['rfd1b4aaa0a4f441da35ecb4dca0bdf7d'])
     
    This is my run history of Get Response Details:
    image.png
    Thanks
  • Community Power Platform Member Profile Picture
    on 01 Jan 2020 at 23:20:15
    Re: Verify if a Microsoft Form has an attachment

    Thanks @abm, would I then use the expression in the condition?  What would that look like?

     

    Thanks!

  • abm abm Profile Picture
    32,585 Most Valuable Professional on 01 Jan 2020 at 23:33:40
    Re: Verify if a Microsoft Form has an attachment

    Hi @Anonymous 

     

    Thanks for the quick reply. Here I have added a compose action. In your case you can add the expression directly under the If condition under the expression tab next to Dynamic content. See below.

     

    image.png

     

    length(body('Get_response_details')?['rfd1b4aaa0a4f441da35ecb4dca0bdf7d'])
     
    If you need any further help please let me know.
     
    Thanks
  • Community Power Platform Member Profile Picture
    on 02 Jan 2020 at 00:02:17
    Re: Verify if a Microsoft Form has an attachment

    @abm I was able to compose the expression successfully, but I don't know where to go from here.  Do I put the "outputs" in a condition to check if there's an attachment?  I feel like I'm missing the next step.

     

    Flow_3.jpg

  • abm abm Profile Picture
    32,585 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

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

  • 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 :)!

  • 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

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

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard
Loading started
Loading started
Loading complete