Skip to main content

Notifications

Power Automate - Building Flows
Answered

Emailing several files from a loop

Like (0) ShareShare
ReportReport
Posted on 27 Jan 2025 13:48:34 by 372
Hello!
 
I have a working flow that creates a file (or files) according to a SP list filter.
 
How many files are created each time, is never the same, so I create each file through a loop.
After this, through an array variable, I get all paths from those created files and I email them.
 
But I can only email each file separately inside the final loop
 
This is my flow:
 
 
Is there a way to email all created files in just one email after the loop??
  • Suggested answer
    Sayan Profile Picture
    Sayan 694 on 30 Jan 2025 at 03:27:58
    Emailing several files from a loop
    @Fernanda No worries. 
     
    Thanks,
    Sayan Patra
    RPA Developer
  • Fernanda Profile Picture
    Fernanda 372 on 28 Jan 2025 at 18:31:20
    Emailing several files from a loop
    @Sayan I have been trying since yesterday to mark it, but it is just not working. I will keep trying though
  • Suggested answer
    Sayan Profile Picture
    Sayan 694 on 28 Jan 2025 at 03:25:25
    Emailing several files from a loop
    Hey @Fernanda  
     
    congratulations!
     
    Is your issue fully resolved now? If so, please mark it as a solution. 
     
     
     
     
    Thanks,
    Sayan Patra
    RPA Developer
     
  • Fernanda Profile Picture
    Fernanda 372 on 27 Jan 2025 at 15:38:45
    Emailing several files from a loop
    @Sayan nevermind me!! I found my mistake!
     
    works perfectly now!! thank you so much!
  • Fernanda Profile Picture
    Fernanda 372 on 27 Jan 2025 at 15:16:10
    Emailing several files from a loop
    @Sayan Hello!
     
    thank you, but I think I did something wrong
     
    As mentioned, I did the append to array variable, in my example, for all 5 documents
     
    I parsed a JSON so I could get the items
     
     
    And i tried the email, but it failed
     
     
     
    If I use an integer index, it will only give me one file, not all.
     
    What did I do wrong?
  • Verified answer
    Sayan Profile Picture
    Sayan 694 on 27 Jan 2025 at 14:35:36
    Emailing several files from a loop
     
    You can use the below approach - 
     
    • Append Each File Path to the Array Variable (Inside the Loop):

      Inside your loop (where you create files), add an Append to Array Variable action. Use the file path or file content from the created file and append it to the array.
     
    • Send Email After the Loop:
      • After the loop, on Send an Email) action.
      • In the attachments section, dynamically reference the array variable where all file paths are stored.
      • For each file path in the array, Power Automate will include it as an attachment in a single email.
     
     

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    If my suggestion helps you, please gives it a Like and Marks as a Solution. Which motivates to solve more problems.

    Thanks,

    Sayan Patra

    RPA Developer

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard
Loading started