Create Dynamics 365 project folder and copy templates inside the folder on SharePoint online using Microsoft FLow



I had an interesting requirement recently where if a Project in created in Microsoft Dynamics 365 – Project Service Automation module, a document should be created in SharePoint and all the document templates needed to be produced / executed during a project life cycle.

I have gone through multiple approaches to achieve this as below:
  1. Create a folder in SharePoint via Plugin when Project record is created and then copy the templates from Dynamics 365 Templates (Available under Setting > Templates in Dynamics 365) using Plugin.
  2. Create a folder in SharePoint via Plugin when Project record is created. Store the template in library, in SharePoint and write a SharePoint Designer workflow to copy the document templates from Templates folder to the newly created Project document.

Plugin approach was complicated and wanted to avoid it due to different reasons.
SharePoint Designer workflow doesn’t support to copy files into a dynamically created folder. If you know the folder path in advance then it is easily possible (This is as per limited SharePoint knowledge gained through various channels).

I wanted to keep the solution simple and Thanks GOD, we have Microsoft Flow which is making the life easy at a lot of pain points.

I did a small POC to try it and it worked simplistically. I am sharing the details below and hope that it will be helpful to someone somewhere.
  1. Enabled the Dynamics 365 and SharePoint integration.
  2. Created a template folder in a SharePoint library and stored few templates there.
  3. Created a field (Is Document?  Field [Yes/No] and set the default value Yes.) on the SharePoint Project Library which was created after Dynamics 365 and SharePoint integration
  4. Created a MS flow which triggers on item create in SharePoint library to copy the files one by one and paste in new Project folder.

Following are few snapshots which should help you set up this MS flow.






Comments

Popular posts from this blog

Jenkins Setup for Salesforce.com Automated Deployment

Cloud based CRMs (Dynamics CRM v.s. Salesforce) -Part 2

Dynamics 365 Customer Engagement Queues and getting the best out it.