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 / Power Automate grabbin...
Power Automate
Suggested Answer

Power Automate grabbing attachments from email account and placing them in a local drive errors

(1) ShareShare
ReportReport
Posted on by 52
Hopefully this is an easy one for you guys. But the flow is to monitor emails in the inbox folder.
Whenever a new email comes through, if it has an attachment, it will take that attachment and place it in a folder on a local shared drive under a specific naming convention.

Where I'm getting stuck at is how to do the condition aka check if the email has an attachment or not.

Trigger is When a new email arrives in a shared mailbox (V2). Parameters in the trigger is "Include attachments" = yes and "Folder" = inbox.
The condition is what I have so far: 
length(triggerOutputs()?['body/Attachments']) greater than 0.

I get the error below. Not sure what else to do here. 


Categories:
I have the same question (0)
  • sdrakedrake Profile Picture
    52 on at
    Ok think im getting closer:

    New screenshot shows that errors are gone. However its skipping the "apply to each part."
    ActionBranchingConditionNotSatisfied
    The execution of template action 'Apply_to_each' skipped: the branching condition for this action is not satisfied.

    I initialized the variable as an array.
    And condition is still: 
    length(variables('EmailAttachments')) is greater than 0..

    Apply to each is the email attachments from the variable. 






  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
    Hi
     
    Sorry I am not following.
     
    What is the Input to the Apply to Each. It cannot be a Number, so its not the length of anything.
     
    Please do in and open the Apply to each. Look a the inputs and outputs it will explain why it didn't do anything.
     
    But what I would like to see specifically is the actual Expression you put in the Input for the Ate.
     
    Thanks,
     
     
  • sdrakedrake Profile Picture
    52 on at
    @flMike 

    Currently there isn't an input for the apply to each. Below is the screenshot. It only says "Select an output from previous step" for the parameter.

    Let me try and type it out as it might be easier to follow:
    Step 1: Trigger - When a new email arrives in a shared mailbox (V2)

                              Parameters: Include attachments_Yes

                                                  Folders_Inbox

    Step 2: Initialize Variable - Name: EmailAttachments

                                               Type: Array

                                               Value: Blank

    Step 3: Compose - Inputs: EmailAttachments (from initialize variable)



    Step 4: Condition - 
    Condition expression

    length(variables('EmailAttachments'))
    is greater than
    0


    Step 5: True - Apply to Each - EmailAttachments (from initialize variable) 

    Step 6: Compose (where im trying to do the naming convention)

    Step 7: Create file

    Step8: Move Email







  • sdrakedrake Profile Picture
    52 on at
    Ok im going to make this a lot less complicated.
    New flow is as follows:

    Trigger - When a new email arrives in a shared mailbox (V2)
                   Parameters - Only With Attachments and Include Attachments = Yes

    Step 2 - Apply To Each 
                  Parameters - Select an output from previous steps* - Attachments

    Step 3 - Create a file (File System SINCE its on a share Drive)

    The current error is 

    Action 'Create_file' failed: Key 'gateway' not found in connection profile.

    So im assuming this error is being caused by some connection issue. Googling trying to figure this out, but point is, I think I have the Condition error resolved. This new error is from the File System action.


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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard