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 Forms - Handling no...
Power Automate
Unanswered

MS Forms - Handling non-required file upload questions -@ChadVKealey

(0) ShareShare
ReportReport
Posted on by 14

 I watched the video (MS Forms - Handling non-required file upload questions) and i am getting the error "ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON')' is of type 'Null'. The result must be a valid array."

 

 

icovsjl_2-1701179532572.pngicovsjl_3-1701179591454.pngicovsjl_4-1701179751042.png

 

 

 

Categories:
  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @icovsjl 

    The error indicates that the Parse JSON action is receiving a null value.

    To begin trouble shooting, take a look at the outputs of previous actions that are used in the Parse JSON action.  Are they what you expected?

  • icovsjl Profile Picture
    14 on at
  • CU29101231-0 Profile Picture
    1,424 Super User 2026 Season 2 on at

    It's hard to diagnose without some additional information. Does your form have more than one "File upload" question? What's being processed in that "Apply to each 2" after the condition?

  • icovsjl Profile Picture
    14 on at

    @ChadVKealey  There is only 1 file upload question. "Apply to each 2" is sending an email using the information indicated on the Microsoft form and using those variables to assign a person. the email is indicating who the assigned person is. 

  • CU29101231-0 Profile Picture
    1,424 Super User 2026 Season 2 on at

    Can you share a screenshot of what's in that loop? According to the error message, you've got a Parse JSON step in there that's trying to process a null value. So, what information is it supposed to be parsing? 

  • icovsjl Profile Picture
    14 on at
  • CU29101231-0 Profile Picture
    1,424 Super User 2026 Season 2 on at

    If you hover over the "Body" at the top of that apply to each, where is that coming from? Also, the email action you're using doesn't support attaching more than one file. Even if varAttachments has only one file, it's still formatted as an array, which (I suspect) is where the loop is coming from. Also, what's the other thing in the first/top "Attachment" field?

  • icovsjl Profile Picture
    14 on at

    Is this the information you needed?

    icovsjl_0-1704834058495.png

    Do you mean this field?

    icovsjl_1-1704834289892.png

     

     

  • CU29101231-0 Profile Picture
    1,424 Super User 2026 Season 2 on at

    Well, that confirms my suspicions. The loop is being created because you're calling the "name" value from the output of the parse JSON action which is failing because there's no file attached. That's why the loop itself is failing. If the file upload question must be optional and you must use that action to send the email, you'll need two "versions" or copies of that action: one that's used if there is a file attached and another that's used if there isn't. 

     

    If you use another email action that allows for multiple attachments (like the Outlook "Send email" or "Send email from shared mailbox"), you can just add the variable to the attachments field (after switching to array entry mode) and it won't care if that array is empty. 

  • icovsjl Profile Picture
    14 on at

    Thanks! So having the below does not fix this?

    icovsjl_0-1704914879491.png

    I didn't create the original flow but I have been owning it for the last year. I say this because I'm not sure why she chose that email action when she created it. By changing to another email action, will i still have the same result?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard