knowledgecenter-breadcrum

Knowledge Center

09 Oct, 2019

Part 2: Use Microsoft Flow to move Notes attachments from Dynamics 365 to SharePoint

Posted on 09 Oct, 2019 by Admin, Posted in Dynamics 365 Power Automate

Part 2: Use Microsoft Flow to move Notes attachments from Dynamics 365 to SharePoint Blogs

Part 2: Use Microsoft Flow to move Notes attachments from Dynamics 365 to SharePoint

Introduction

This is second part of blog, which I published few days back. Second part explains how we can use SharePoint integration to create folder structure and move the attachments to SharePoint using MS Flow.

Note:I have removed basic steps in this blog as I have explained the steps in details in first part of the blog.

Problem Statement

Let’s assume we have below requirements to be achieved using Microsoft Flow.

  1. We have Boolean field on Account entity as Move Attachments.
  2. On account we have multiple contacts, on each contact we have multiple attachments in Notes.
  3. When user will set the Move Attachments field to YES, all the attachments of associated contacts should be moved to SharePoint in the folder with Account’s GUID as folder name.
  4. After successful operation, attachments should be deleted from CRM.
  5. After completion of all operation, Move Attachments field should be set to NO.

Solution – With SharePoint Integration

I have not explained how SharePoint integration is enabled. I am assuming that, we have enabled SharePoint integration on Account entity & document library with name account exists in SharePoint.

1. Create a blank flow.
2. Add Dynamics 365 – When Record is updated trigger for Account entity.
3. Add Condition and check if Move Attachments is equal to True.
4. If true branch of condition, add Dynamics 365 – List Records action.

5. Add Dynamics 365 – List Records action as per below.

6. Add Apply to Each control as shown below.

7. Add Dynamics 365 – List Records action as per below.

8. Add Apply to Each control as shown below.

9. Add Condition control inside the For Each attachment component. Refer below screenshot.

10. In TRUE branch of condition, add Apply to Each control. Refer below screenshot.
 

    a.  Add SharePoint - Create File action.
    b.  Add an action as Dynamics 365 - Delete a record.

11. In FALSE branch of condition, add below components.

    a.  Add SharePoint - Create File action.
    b.  Add an action as Dynamics 365 - Delete a record.

12. Save the Flow & see the working demo by creating accounts, their contacts & attachments on the contacts. You can also see the attachments from CRM record itself.

Comment

This is a Required Field

Loading

Recent Updates

Thumbnail_top 10 benefits of
Blogs
02 Dec, 2024

Top 10 Benefits of Microsoft Dynamics 365

This blog lists the advantages of Microsoft Dynamics 365, focusing on how it can improve your business operations.    …

READ MORE
Thumbnail_Microsoft365 Vs D365
Blogs
12 Nov, 2024

Microsoft 365 vs Dynamics 365

This blog will help you understand the key difference between Microsoft 365 and Dynamics 365, so you can make an…

READ MORE
Thumbnail_What is Microsoft Dynamics 365
Blogs
05 Nov, 2024

What is Microsoft Dynamics 365?

This blog explores Microsoft Dynamics 365, a cloud solution for handling different business activities smoothly. The rising trends of competition…

READ MORE