Skip to main content

Notifications

Power Automate - Building Flows
Answered

Attaching multiple documents dynamically for Approval Flow

(0) ShareShare
ReportReport
Posted on by 1,085

I have a SharePoint list where am starting my approval flow when a new item in created. The requirement is number of attachments for each item submitted can be 1 or more which is not fixed number. How can I tell my flow to send those attachments in my approval email? Its clear in the action for fixed number of attachments. But when the number of attachments is only known during item submission, how can I deal with this?

 

RameshMukka_0-1601199522957.png

 

  • rameshmukka Profile Picture
    rameshmukka 1,085 on at
    Re: Attaching multiple documents dynamically for Approval Flow

    @efialttes @yashag2255 I lately noticed that attachments coming to email are corrupted. Is this something to with base64 conversion?

     

    Once again this is how my array is looking like and my expression

     

    Attachment Content Error3.PNG

    body('Get_attachment_content')['$content']

    Also used this outputs('Get_attachment_content')?['body'].$content. 

     

    What are the differences between both of them? Which one should I be using?

     

    In both cases my attachments are corrupted.

     

    Attachment Content Error4.PNG

  • rameshmukka Profile Picture
    rameshmukka 1,085 on at
    Re: Attaching multiple documents dynamically for Approval Flow

    @efialttes Thank you so much. Replacing ContentBytes with Content has fixed the problem.

     

    RameshMukka_0-1601215559320.png

     

  • Verified answer
    efialttes Profile Picture
    efialttes 14,756 on at
    Re: Attaching multiple documents dynamically for Approval Flow

    Hi again!

    Not sure if base64() will make the difference as explained in this great article

    https://blog.mattweston365.com/2020/03/sending-multiple-attachments.html?m=1

     

    If not succeed, please note I just searched for the error text and found a promising thread in this same forum

    https://powerusers.microsoft.com/t5/General-Power-Automate/Power-Automate-approval-with-Attachments/td-p/415327

     

    Hope this helps

     

     

  • rameshmukka Profile Picture
    rameshmukka 1,085 on at
    Re: Attaching multiple documents dynamically for Approval Flow

    @efialttes I exactly did it and somehow the flow is failing at getting the contentbytes. Here is what i have with error

     

    RameshMukka_0-1601209335456.png

     

    My expression for getting attachment content

     

    outputs('Get_attachment_content')?['body'].$content

    Attachment Content Error.PNG

     
     
     

    I have used my AllAttachments Variable in the approval action. Dont know what is going wrong here.

    Attachment Content Error2.PNG

  • efialttes Profile Picture
    efialttes 14,756 on at
    Re: Attaching multiple documents dynamically for Approval Flow

    Hi!

    On the 'Start and wat for an approval' attachments section you can see an icon on the right (capital T surrounded by a square). When you click on it you switch into Input Array mode, meaning you can buid an array whose elements are your file attachnents and assing it as its input.

    Same approach as the one described in this thread

    https://powerusers.microsoft.com/t5/Building-Flows/Creating-array-of-attachments-for-apporval-email/td-p/77328

     

    Hope this helps

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,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard