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 Automate
Suggested Answer

Duplicated Trigger

(0) ShareShare
ReportReport
Posted on by
I tested the flow by sending an email with an attachment. However, the trigger appears to duplicate the flow, resulting in seven attachment inputs. The first input produces the expected output, inputs 2-6 result in errors, and the 7th input yields a null data output.What setting do I need more in order to get only the first input. I have tried to turn off the split on setting but it appear to have 1 input but with an error. ExpressionEvaluationFailed
The execution of template action 'For_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body/attachments']' is of type 'Null'. The result must be a valid array.
2024-12-08_10h44_29.png
2024-12-08_10h44_19.png
2024-12-08_10h44_42.png
Categories:
I have the same question (0)
  • Suggested answer
    SwatiSTW Profile Picture
    807 Super User 2026 Season 1 on at
    The bug is that your flow is treating the attachments array incorrectly. Either it is misconfigured (e.g., Split On is causing duplication), or the array is empty/null, leading to errors in the "For each" loop when trying to process it.
     
    Simple Fix:
    1. Go to your trigger ("When a new email arrives in a shared mailbox (V2)") and disable the "Split On" setting in the trigger's advanced settings.
    2. Add a Compose action after the trigger with this expression:
    @triggerOutputs()?['body/attachments']
    3. Add a Condition action to check if the attachments exist. Use this expression in the condition:
    @not(empty(outputs('Compose')))
    If True (Yes): Proceed to the "For each" loop.
    If False (No): Do nothing or terminate the flow.
    4. Update the "For each" loop to use the output of the Compose action. Use this expression for the loop input:
    outputs('Compose')
    5.  the loop, ensure all actions process one attachment at a time.
  • Suggested answer
    SamLed Profile Picture
    2,338 Moderator on at
    Hi,
     
    Just add @not(empty(@triggerOutputs()?['body/attachments'])) as trigger condition. Need no condition in flow and Apply to each will not fail as flow will only be triggered when mails have attachments.
     
     
    _______________________________________________________________________________
    If this is the answer for your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard