Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Upload pdf file to Vendor master (VendorDocumentAttachmentEntity ) using Flows on Power automate

Posted on by 13
I've been trying to import pdf file (w9 file) to Vendor document attachment entity but it shows "We can't open this file" in Preview and it looks like the file was not imported into D365FO. Tried to open the file (download the file) but it was not readable.

Does anyone know how to solve the problem or how to upload pdf file to Vendor master using power automate?

My ultimate goal is scan the documents (vendor request form and W9) from procurement team and create the vendor master and attach pdf W9 form to the vendor.

Here is the message on Preview.



Here is my flows.  Maybe Initialize the variable and set the variable parts are not necessary. I was just following guidance from someone's blog.
1. Upload the file

2. Initialize the "FileContents" as String
 
3&4. For Parse Jason and Compose parts, I just removed unnecessary text from contents. 
 example: 
       Original text >> {"contentBytes":"dGVzdA==","name":"test.txt"}
          After3&4   >> dGVzdA==

5. Set Output from Compose to Variable "FileContents".
 
6. Adding new row in Vendor document attachments entity. In Archive file field, I convert String to Base64. Used this Expression: base64(variables('FileContents'))
 
 

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,336 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans