web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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,499 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard