With PowerAttachment, users were able to set attachments to automatically sync to their SharePoint sites – stripping the actual attachment from Dynamics 365 and replacing it with a link to the document that is now stored in SharePoint. It works with all entities and their attachments. And if you ever needed to leave attachments intact for a specific entity, you could simply define the entity in the PowerAttachment configuration, and the solution would ignore those attachments. It was a slick PowerObjects-designed solution that we deprecated on June 30, 2020.
Why would we sunset such a useful tool? A simple flow built using Microsoft technology essentially renders PowerAttachment obsolete. We can still fight the Dynamics 365 storage war – we’ll just do it with the help of Power Automate!
Power Automate gives end users the ability to automate tasks for themselves. It’s true! As the name suggests, Microsoft Power Automate is all about process automation. It allows anyone with knowledge of the business process to create repeatable flows that when triggered leap into action and perform a process for them. In this post, we’ll show you how to use Power Automate to replicate the PowerAttachment functionality. You will learn how to:
- Use Power Automate for moving attachments from D365 to SharePoint.
- Move only PNG file types to SharePoint.
- Move attachments only from Accounts Entity
- Keep all attachments in a single folder.
Let’s get started!
Power Automate flow for moving attachments from D365 to SharePoint
1. Go to https://flow.microsoft.com/ and sign in for a trial version of Power Automate (or subscribe).
2. After you log in to Power Automate, Click MyFlows from the left navigation pane.
3. Click New > Automated–from blank.
4. Give a suitable name to your flow in the Flow name field and also choose the trigger for your flow . For this example, select When a Record is created.
5. Provide the details (as described below) and click + New step
- Environment: Choose your environment (Ideally there should be only one)
- Entity Name: Notes
- Scope: Organization
6. Search ‘SharePoint create a file’ under All and click Create file.
7. Fill in the required details and click + New step.
- Site Address: SharePoint site URL
- Folder path: SharePoint folder location
- File Name: Name of the file (Select File Name from the list)
- File Content: Select Document from the list
8. Search ‘SharePoint create sharing link’ under All and select Create sharing link for a file or folder.
9. Fill in the details as show below and click + New step.
10. Search for and select Update a record.
11. Fill in details as shown below and click Save.
- Organization Name: Select your Organization
- Entity Name: Notes
- Record Identifier: Note (select from the dynamic content list)
- Is Document: No
- Description: ‘Description’ ‘Sharing link’ (Select from the dynamic content)
- File Name: Space
Now your Power Automate flow is ready. Go ahead and create a note in any entity and add an attachment to it. Refresh the page and see the attachment is replaced with a SharePoint link.
You can also use create some advanced features like moving only PNG files or moving attachments only from an Accounts entity, or if you wish to keep attachments in a single folder.
Scenario 1: If you want to move only PNG file types to SharePoint.
1. Under When a record is created, click Add an action.
2. Search for and select that Condition control.
3. Mention the condition as Mime Type is equal to image/png and move all below actions to the Yes condition (drag and drop will work).
Scenario 2: If you want to move attachments only from Accounts Entity
Add a condition and set Regarding Type is equal to accounts.
Scenario 3: If you want to keep all attachments of a record in a single folder
While creating the file, mention Regarding after the Folder Path.
The above information will help you to replicate the work of PowerAttachment. And if you are looking for more alternative solutions, we have great resources at PowerObjects! We’d be happy to discuss the possibility of a custom solution. For inquiries, please submit a request in our Contact Us Page and it will connect you with our sales team.
Also, if you have ideas for other add-ons being deprecated, add-ons that are still supported, or new add-ons, know that you can always post them in our customer ideas forum: https://ideas.powerobjects.com/.
We look forward to bringing you new and exciting technologies in the near future. Happy D365’ing!