Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Workflow to create SharePoint folder automatically

  • 1.  Workflow to create SharePoint folder automatically

    TOP CONTRIBUTOR
    Posted 10-18-2016 06:47 PM

    Hi everyone-

    Is there a way to have a workflow create a SharePoint folder in a document library automatically?  When a new product is created, we want to have the folder for all the stuff we keep about the product created automatically.

    Thank you.

    -Joe

    ------------------------------
    Joseph Markovich
    IT Manager
    Okaya Electric America
    Valparaiso IN
    ------------------------------


  • 2.  RE: Workflow to create SharePoint folder automatically

    MICROSOFT MVP
    Posted 10-18-2016 08:29 PM

    If you want the process fully automated, a plug-in which creates the CRM Document Location record and the folder in SharePoint is usually the way to go. Requires some development (CRM & SharePoint) knowledge and usually requires credentials be stored someplace for a SharePoint service account to handle the SharePoint work as there isn't a good way to use the current user in the context of a plug-in. 

    The next closest option would be to change the Document Management settings to enable automatic folder creation and the navigate to the Documents on the record and the folder would be created in SharePoint without prompting the user. 

    ------------------------------
    Jason Lattimer
    Dynamics CRM MVP
    PowerObjects HCL
    Greenville WI



  • 3.  RE: Workflow to create SharePoint folder automatically

    SILVER CONTRIBUTOR
    Posted 10-19-2016 04:36 AM

    Hi Joseph,

    A plugin would do the trick as outlined by Jason Lattimer.
    However, our DocumentsCorePack comes with custom workflow activities that allow for creating document locations, folders as well as subfolders on SharePoint right inside CRM workflows. 

    As you are an existing DCP customer i guess this is the most easy route to go :)

    br, Michael

    ------------------------------
    Michael Dohr
    mscrm-addons.com
    Atlanta GA



  • 4.  RE: Workflow to create SharePoint folder automatically

    GOLD CONTRIBUTOR
    Posted 6 days ago
    Edited by Ryan Perry 6 days ago
    As @Jason Lattimer indicates, one could write custom code to trigger the document location creation and folder creation on sharepoint.  One could also turn on automatic folder creation, but the users have to click the document location link for this to be triggered.
    @Michael Dohr, The Documents Core Pack looks like a great product, but probably overkill.

    Under the hood, there must be a method / action / OOB plugin / organization service request that performs this action.  Does anybody know what it is / how to trigger it? We'd like to trigger the OOB code immediately upon record creation (ie without having the user need to navigate to the document location), but don't wish to write or maintain a whole new set of plugins to do what the system is already doing when users click the document  locations link.  Anybody know what the OOB mechanism is triggered when clicking this and how to trigger it via workflow or in a custom workflow activity / plugin (still custom code, but simpler than coding the whole thing)?


    ​​

    ------------------------------
    Ryan Perry
    Business Systems Analyst
    Auric Solar
    ------------------------------



  • 5.  RE: Workflow to create SharePoint folder automatically

    Posted 5 days ago
    ​is there not a way to update all the Product records document location field to what it would be if created via the OOTB process? or am I totally missing several things?

    ------------------------------
    Robin Marshall
    Dynamics Competency Centre Lead
    Babcock International
    ------------------------------



  • 6.  RE: Workflow to create SharePoint folder automatically

    TOP CONTRIBUTOR
    Posted 6 days ago
    Based on your request, it seems like the OOTB Document Management would suffice because it would create a folder in SharePoint for each product you create. Another no-code solution is to use Logic Apps (and possibly Flow, but Logic Apps is much less expensive to use). I created a Logic App for one client that would take documents attached to Notes in CRM and move them to SharePoint, plus it updated the document metadata using fields from CRM.

    ------------------------------
    Nelson Johnson
    Solution Architect
    BroadPoint, Inc.
    Bethesda MD
    Link with me! https://www.linkedin.com/in/nelsonjohnson/
    ------------------------------



  • 7.  RE: Workflow to create SharePoint folder automatically

    GOLD CONTRIBUTOR
    Posted 5 days ago
    I think what @Joseph C. Markovich was asking was for a way to create the document location upon record creation.   Note, his post is from 2016, so maybe he figured out a solution. Any input Joseph?

    @Robin Marshall, You suggested just updating a location field with where it would be created, before it happens.  As I understand it, I believe I am facing the same need, and this would almost work. We were tempted to do it. But it really would be best to create the actual folder on sharepoint upon record creation, rather than just a link to where it likely will be. This enables other automated process to utilize the document location (Assuresign in our case) without having to wait for the user to trigger its creation or guess where it will be created. If you did populate a URL field with the expected location and have the other processes use that location, it would mostly work. IE if document locations are filed under the account folder by default. In our case, we are working to do it on Project records, so we'd expected URL to be https://sharepointsite/accounts/accountname/projects/projectname. I see two potential issues:
    1. There is the potential to guess wrong. IE, in our case, documents locations are filed under the account, but if one isn't created first, just under a separate projects folder outside of the accounts. The project or account could be created or renamed after the URL is guessed, but before the actual folder is created based on the changed values. While it would work 98% of the time, there is still the potential for a mismatch, which could lead to multiple locations being created. 
    2. If you simply displayed the expected location link without also creating the folder and users clicked it before running the assuresign process (In our case, clicking the link, rather than clicking "Documents" in the menu before signing the contract on assuresign, they'd get an HTTP 404 Not Found. 
    So, it seems the simplest solution be to trigger the OOB process that the user triggers, just needs to happen sooner for processes that require it to be in place first. How can one trigger it via code / workflow? I'd have expected it would be as simple as passing some sort of organizationservicerequest or calling a predefined action. After all, when users click the location, something is being called.

    ------------------------------
    Ryan Perry
    Business Systems Analyst
    Auric Solar
    ------------------------------



  • 8.  RE: Workflow to create SharePoint folder automatically

    Posted 5 days ago
    I have successfully set up a Nintex workflow in SharePoint to query our on-prem D365 SQL db in order to get the Opportunity owning team members so that I can map the permissions from Dynamics to SharePoint content. We have OTB Document setting for the Opportunity entity so still rely on users first goingto an opportunity and selecting Documents from the common menu to initiate the location creation.

    @Ryan Perry, you could use Nintex to query your Projects db to set up a new location for each before a user goes to Documents section in Dynamics, and using the guid will mean updates to the Name will not have an impact. Not sure you can do any of this outside on-prem however?!


    ------------------------------
    Robin Marshall
    Dynamics Competency Centre Lead
    Babcock International
    ------------------------------



  • 9.  RE: Workflow to create SharePoint folder automatically

    SILVER CONTRIBUTOR
    Posted 4 days ago
    If you are running the online version in O365, I would recommend Microsoft Flow - we have implemented a similar solution around custom entities.  It's a very simple visual workflow-ish environment and lets you simply trigger the creation of a SharePoint folder based on a CRM record being created. The great advantage doing it this way is that it's very easy to control the folder naming that you want to achieve in SharePoint.

    ------------------------------
    Jeff Woodard
    Chief Technical Officer
    Transportation Financial Services, Inc.
    West Palm Beach FL
    ------------------------------



  • 10.  RE: Workflow to create SharePoint folder automatically

    TOP CONTRIBUTOR
    Posted 4 days ago
    Hey @Ryan Perry

    This is another topic I completely forgot I had posted. Since I posted this forever ago, we gave up with attempting to do this automatically.

    Fast forward two years and both @Nelson Johnson and @Jeff Woodard have great solutions.

    I was able to see Nelson's at his session at Summit last year and it was one of the highlights of my conference. Jeff's is great too because it is relatively simple with Flow.

    We'll implement one of these solutions soon -- once we get some other challenging projects out of the way. The plan is to still be using the SharePoint integration but not for every entity because of other processes around our public-facing website and surfacing documents to the users. We have to use the Notes for some things going forward.

    Thanks.
    Joe
    ​​​

    ------------------------------
    Joseph C. Markovich
    IT Manager
    Okaya Electric America
    Valparaiso IN
    ------------------------------