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 / Approval with or witho...
Power Automate
Unanswered

Approval with or without attachments

(0) ShareShare
ReportReport
Posted on by 23

I've got an approval process based on a MS Forms submission that may or may not include file attachments. The flow is giving an error that says "The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Compose')' is of type 'Null'. The result must be a valid array." 

 

How do I build the flow so that it sends the approval with or without attachments?

hmenzel_0-1667948834622.png

 

hmenzel_1-1667948865715.png

 

hmenzel_2-1667948889448.png

 

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Check for an empty compose action before applying the loop.

    equals(empty(outputs('Compose')'),true)

     

  • carloxvii Profile Picture
    95 on at

    Hi there @hmenzel ,

    Try to add a condition to check if the submission does or doesn't include a file by using an empty expression.

    carloxvii_1-1667963811993.png

     

     

  • hmenzel Profile Picture
    23 on at

    This worked! Thank you so much!!

  • hmenzel Profile Picture
    23 on at

    There's a new issue. The approvals are coming in without attachments. I want the approval to send with or without attachments, depending on if attachments were uploaded. I think the issue is that I can't attach/link the file content (varFiles) to the approval (it's not available in the Dynamic content). Any tips?

    hmenzel_0-1668708870001.png

    hmenzel_1-1668708897920.png

    hmenzel_2-1668708918026.png

     

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    That one's easy

    SudeepGhatakNZ_0-1668718550834.png

     

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 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard