Import attachments using PowerAutomate – D365FO
In this blog , let us have a walkthrough of uploading the attachments to FO using PowerAutomate. This approach can be used in logic apps also.
In my instance, the files uploaded in one drive are read and imported to Customers. The file name carries the Customer number and this becomes one of the input in Attachment process.
Given below the complete pic of the flow

There are 2 files in my onedrive

File content variable is initialized as String and is left null . The value will be populated in the later stage of the flow.
Next is to ‘List the files from the folder’ . In my case, the files are placed in the folder named ‘Attachments’

Above step would give us the list of files in the folder. With this information, let us use ‘Get File Content using path’ to read the contents.

System automatically brings the loop as the output of ‘List files’ is an array ,and thus it has to loop through the items to read each of its contents.

Assign the output of the file content to the variable which was created in the first step.

Tricky part here is not to use the ‘File contents’ directly . It has to be converted to base64 in the expression.

As the file name refers to the Customer number here, value for this input field is taken from the property.


Use the authentication in the above step and the flow is ready to be executed.
When the flow is executed , the file is seen as attachment in the system.

It is also possible to preview the file and open the attachment .
This feature can be be extended using AI connector to read the file and upload the attachment for invoice journals, items etc.,
I will explore that option and post the details soon.
This was originally posted here.

Like
Report
*This post is locked for comments