Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

How do I add an attachment to a Purchase Invoice Line via Power Automate / Flow?

Posted on by 321
Hello -- hoping somebody can help with this flow.

I'm creating a Purchase Invoice with corresponding Purchase Invoice Lines, and I want to attach an image of a receipt to the Purchase Invoice Line. 

I can get the content into flow and BC, but I'm missing a step when it comes to adding the attachment.
 
My flow uses this step:
 
//
I can find the path for PurchaseInvoiceLines/item/documentAttachments/attachmentContent, and I'm passing the ID of the purchaseInvoiceLine and the content, but I have no idea what to use for the documentAttachments ID.
 
I tried creating a documentAttachment record, but purchaseInvoiceLine isn't one of the valid Parent Types, so I can't create a documentAttachment to get the ID.
 
Any ideas how this is intended to work? 

Any ideas / suggestions are appreciated.
 
Thanks!

Garrett
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 68,341 Super User 2024 Season 2 on at
    How do I add an attachment to a Purchase Invoice Line via Power Automate / Flow?
    Hi, unfortunately, as far as I know so far, the standard attachment API is Incoming Document (table 130), not Document Attachment (table 1173).
    More details:
     
    If you need to add attachments, you need to customize a new API. Here is a simple example for web service.
     
     
    Hope this helps.
    Thanks.
    ZHU
     

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,246 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,041 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans