31 Jan’19

D365 GeneralCreate Folder Strucutre in SharePoint using MS Flows

Introduction:

In this blog we will see how we can create folder structure in SharePoint for Leads when the record is created in CRM using MS Flows

Pre Requisites:

SharePoint Integration must be enabled for the required entities

Implementation

Step 1: Here in our Flows we have used “Create of a record(Leads)” as trigger condition.

Trigger Condition Lead creation

Step 2: Then we create the folder structure in SharePoint using the “Create File” action
Here we will create a text file which can be deleted later if not required.
Folder Path: /Lead/Topic_toUpper(replace(triggerBody()?[‘leadid’],’-‘,”))
Here “Topic” is Dynamics value and for the record ID copy paste the expression written above in the Expressions tab and add it at the end of the Folder Path.

Create main folder

After we have created the folder structure if the file is not required we can delete the text file by adding the delete step as shown below
Delete File

Step 3: We will also store the Folder ID in a variable “FolderId” to use in the later steps
FolderID variable

Step 4: Now we will create the same folder structure in CRM (Document Location)
Create Document Location 1

Document Location 2

Here for the parent site or Location we have we have added the GUID of the Parent Document Location site for Leads.
We can get this from the URL of the Parent Document Location record from Advanced Find (Document Location Entity)
Document Location Default Site

Lead document location record URL: https://org.crm8.dynamics.com/main.aspx?etc=9508&extraqs=%3f_gridType%3d9508%26etc%3d9508%26id%3d%257b1957C431-5F15-E911-A96F-000D3AF29269%257d%26rskey%3d%257bF5B008AC-07D9-4554-8509-2C05767BFF51%257d&histKey=17520860&newWindow=true&pagetype=entityrecord&rskey=%7bF5B008AC-07D9-4554-8509-2C05767BFF51%7d#371473802

Step 5:  Similarly we can also create sub folders within the main folder as per the requirements

Hope this Helped!

Written by

Clinton D'Mello

Software Engineer

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Bulk Clear field values in D365

    15 February’ 2019

    Introduction: A very handy approach for admins and users of Dynamics 365 who want to bulk clean up field values – And...

    Read more
  • Integrating SharePoint with D365 Portal

    8 February’ 2019

    Introduction: This blog explains how we can add files from D365 Portal directly into SharePoint which was long awaited ...

    Read more
  • Run OnDemand Workflow in D365 CE UCI Apps

    31 January’ 2019

    Introduction: This blog explains the steps on how to enable OnDemand Workflow in D365 CE UCI Apps. Scenario: After clien...

    Read more
  • Create Folder Strucutre in SharePoint using MS Flows

    31 January’ 2019

    Introduction: In this blog we will see how we can create folder structure in SharePoint for Leads when the record is cr...

    Read more
  • Hide table or column in Power BI

    30 January’ 2019

    Introduction: In this article we will read on how to hide a table or column in Power BI Web Service. Scenario: I have a...

    Read more

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close