{"id":466,"date":"2024-10-01T20:45:49","date_gmt":"2024-10-01T20:45:49","guid":{"rendered":"https:\/\/niklas-boesch.de\/?p=466"},"modified":"2024-10-04T10:57:02","modified_gmt":"2024-10-04T08:57:02","slug":"integrating-dynamics-365-with-existing-microsoft-teams-file-structures","status":"publish","type":"post","link":"https:\/\/niklas-boesch.de\/en\/2024\/10\/integrating-dynamics-365-with-existing-microsoft-teams-file-structures","title":{"rendered":"Integrating Dynamics 365 with existing Microsoft Teams File Structures"},"content":{"rendered":"<p>Imagine this: your team has built an efficient file organization system in Microsoft Teams, where each customer has their own dedicated folder within your general team channel. It\u2019s straightforward and ensures everyone can easily access the files they need.<br>But when it&#8217;s time to link these folders to Dynamics 365, you&#8217;re faced with a dilemma: none of the built-in options support your existing structure. What do you do?<\/p>\n\n\n\n<p>When connecting Dynamics 365 to SharePoint, there are two advertised methods: <br>1. Use the out-of-the-box <a href=\"https:\/\/learn.microsoft.com\/en-us\/power-platform\/admin\/set-up-dynamics-365-online-to-use-sharepoint-online\">Server-Based SharePoint Integration<\/a><br>2. <a href=\"https:\/\/learn.microsoft.com\/en-us\/dynamics365\/sales\/teams-integration\/enable-record-linking\">Link <\/a>individual records with a Microsoft Teams channel and access the <strong>Files<\/strong> tab (which is just SharePoint in the background)<br><br>If you don\u2019t want to change your current setup of one folder per customer under a general team channel, official documentation falls short.<\/p>\n\n\n\n<p>Here&#8217;s the good news: there is a way to keep your files in the same location and still connect each individual folder to a record in Dataverse. The downside is that you&#8217;ll need to manage the creation of new folders yourself.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"0-creating-the-sharepoint-site-record\">Creating the SharePoint Site record<\/h3>\n\n\n\n<p>The folder shown in the <strong>Documents <\/strong>tab on a Dynamics 365 record is controlled by a related <em>sharepointdocumentlocation&nbsp;<\/em>record. This document location must have a relation to another record in the <em>sharepointsite&nbsp;<\/em>table, where the URL to SharePoint is stored.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"756\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/image-1024x756.png\" alt=\"\" class=\"wp-image-469\" style=\"object-fit:cover\" srcset=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/image-1024x756.png 1024w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/image-300x221.png 300w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/image-768x567.png 768w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/image.png 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>First, we need to find the SharePoint Site which is connected to Teams, so open the tab in your Teams channel in which the folders you want to connect are and open SharePoint via the command bar. Copy the URL up to and including the team name (NiklasBschConsulting in the screenshot).<\/p>\n\n\n<div id=\"metaslider-id-486\" style=\"width: 100%;\" class=\"ml-slider-3-107-0 metaslider metaslider-flex metaslider-486 ml-slider ml-slider-lightbox-2-22-0 firelight-lightbox-2-3-19 ms-theme-default nav-hidden\" role=\"region\" aria-label=\"Teams Sharepoint URL Slideshow\" data-height=\"400\" data-width=\"800\">\n    <div id=\"metaslider_container_486\">\n        <div id=\"metaslider_486\">\n            <ul class='slides'>\n                <li style=\"display: block; width: 100%;\" class=\"slide-488 ms-image\" aria-roledescription=\"slide\" data-date=\"2024-10-01 20:18:10\" data-filename=\"Teams-Open-in-Sharepoint-800x400.png\" data-slide-type=\"image\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Teams-Open-in-Sharepoint-800x400.png\" height=\"400\" width=\"800\" alt=\"\" class=\"slider-486 slide-488 msDefaultImage ml-lightbox-enabled\" title=\"Teams Open in Sharepoint Button\" \/><\/li>\n                <li style=\"display: none; width: 100%;\" class=\"slide-487 ms-image\" aria-roledescription=\"slide\" data-date=\"2024-10-01 20:18:10\" data-filename=\"Copy-Sharepoint-URL-800x400.png\" data-slide-type=\"image\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Copy-Sharepoint-URL-800x400.png\" height=\"400\" width=\"800\" alt=\"\" class=\"slider-486 slide-487 msDefaultImage ml-lightbox-enabled\" title=\"Copy Sharepoint URL\" \/><\/li>\n            <\/ul>\n        <\/div>\n        \n    <\/div>\n<\/div>\n\n\n\n<p>Now, create the <em>sharepointsite&nbsp;<\/em> record in Dynamics 365. I&#8217;m using the new settings experience, but it works the same with the old one. Set the <em>Name <\/em>field with a display name and the <em>Absolute URL<\/em> field with the URL you just copied. Check <em>List component is installed<\/em> as well.<br><br>After saving, you need to copy the GUID of the newly created record. <br>The <em>sharepointsite <\/em>table has a poorly documented choice attribute called <em>Service Type<\/em>, which can not be added to a form but needs to be set to the right value if the record refers to anything but a standard SharePoint Site. In the case of MS Teams Files, it needs to be set to 3 (MS Teams). I&#8217;m using the Dataverse REST Builder in XrmToolBox for this, as in the screenshot below.<\/p>\n\n\n<div id=\"metaslider-id-490\" style=\"width: 100%;\" class=\"ml-slider-3-107-0 metaslider metaslider-flex metaslider-490 ml-slider ml-slider-lightbox-2-22-0 firelight-lightbox-2-3-19 ms-theme-default nav-hidden nav-hidden\" role=\"region\" aria-label=\"Create Sharepoint Site\" data-height=\"400\" data-width=\"800\">\n    <div id=\"metaslider_container_490\">\n        <div id=\"metaslider_490\">\n            <ul class='slides'>\n                <li style=\"display: block; width: 100%;\" class=\"slide-491 ms-image\" aria-roledescription=\"slide\" data-date=\"2024-10-01 20:25:26\" data-filename=\"Create-Sharepoint-Site-800x400.png\" data-slide-type=\"image\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Create-Sharepoint-Site-800x400.png\" height=\"400\" width=\"800\" alt=\"\" class=\"slider-490 slide-491 msDefaultImage ml-lightbox-enabled\" title=\"Create Sharepoint Site\" \/><\/li>\n                <li style=\"display: none; width: 100%;\" class=\"slide-492 ms-image\" aria-roledescription=\"slide\" data-date=\"2024-10-01 20:25:26\" data-filename=\"Dataverse-REST-Builder-800x400.png\" data-slide-type=\"image\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Dataverse-REST-Builder-800x400.png\" height=\"400\" width=\"800\" alt=\"\" class=\"slider-490 slide-492 msDefaultImage ml-lightbox-enabled\" title=\"Dataverse REST Builder\" \/><\/li>\n            <\/ul>\n        <\/div>\n        \n    <\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><br>Creating Document Locations<\/h3>\n\n\n\n<p>The next step is creating Document Locations. This step will be different depending on your current Teams SharePoint folder structure. In my demo case, I created the customer folders in the Files tab without any subfolders, so in SharePoint there were two automatically generated folders &#8222;Freigegebene Dokumente&#8220; (Shared Folders in english, but this is a german tenant) and then &#8222;General&#8220;. In &#8222;General&#8220; were the three folders &#8222;A. Datum Corporation&#8220;, &#8222;Blue Yonder Airlines&#8220; and &#8222;Fourth Coffee&#8220;. So in sum, to connect the three accounts to the folders, five Document Locations need to be created.<\/p>\n\n\n\n<p>For every folder you want to connect to a Dynamics record, you\u2019ll need a corresponding Document Location. Don\u2019t forget: you\u2019ll also need to create one for each parent folder. This can be done from the SharePoint Site record under &#8222;Related&#8220; &#8211; &#8222;Document Locations&#8220;. Fill in the display name (usually just the folder name) and the <em>Relative URL<\/em> (folder name as well). You also need to choose the right <em>Parent Site or Location<\/em>, which is either going to be the SharePoint Site created earlier or the parent folder document location. For any Document Location you want to show on a record, fill the <em>Regarding <\/em>Lookup just like an activity.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2558\" height=\"1107\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Document-Location-Setup.png\" alt=\"\" class=\"wp-image-476\" srcset=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Document-Location-Setup.png 2558w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Document-Location-Setup-300x130.png 300w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Document-Location-Setup-1024x443.png 1024w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Document-Location-Setup-768x332.png 768w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Document-Location-Setup-1536x665.png 1536w, https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Document-Location-Setup-2048x886.png 2048w\" sizes=\"auto, (max-width: 2558px) 100vw, 2558px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Nearly done&#8230;<\/h3>\n\n\n\n<p>The last step is enabling the &#8222;Setting up SharePoint document management&#8220; setting for all tables you want to connect in the table properties and adding the document subgrid to your form.<\/p>\n\n\n<div id=\"metaslider-id-493\" style=\"width: 100%;\" class=\"ml-slider-3-107-0 metaslider metaslider-flex metaslider-493 ml-slider ml-slider-lightbox-2-22-0 firelight-lightbox-2-3-19 ms-theme-default nav-hidden nav-hidden nav-hidden\" role=\"region\" aria-label=\"Sharepoint Final Settings\" data-height=\"400\" data-width=\"800\">\n    <div id=\"metaslider_container_493\">\n        <div id=\"metaslider_493\">\n            <ul class='slides'>\n                <li style=\"display: block; width: 100%;\" class=\"slide-494 ms-image\" aria-roledescription=\"slide\" data-date=\"2024-10-01 20:26:49\" data-filename=\"Sharepoint-Table-Setting-800x400.png\" data-slide-type=\"image\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Sharepoint-Table-Setting-800x400.png\" height=\"400\" width=\"800\" alt=\"\" class=\"slider-493 slide-494 msDefaultImage ml-lightbox-enabled\" title=\"Sharepoint Table Setting\" \/><\/li>\n                <li style=\"display: none; width: 100%;\" class=\"slide-495 ms-image\" aria-roledescription=\"slide\" data-date=\"2024-10-01 20:26:49\" data-filename=\"Account-Form-Maker-Portal-800x400.png\" data-slide-type=\"image\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Account-Form-Maker-Portal-800x400.png\" height=\"400\" width=\"800\" alt=\"\" class=\"slider-493 slide-495 msDefaultImage ml-lightbox-enabled\" title=\"Account Form Maker Portal\" \/><\/li>\n                <li style=\"display: none; width: 100%;\" class=\"slide-497 ms-image\" aria-roledescription=\"slide\" data-date=\"2024-10-01 20:29:31\" data-filename=\"Account-Form-Display-800x400.png\" data-slide-type=\"image\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Account-Form-Display-800x400.png\" height=\"400\" width=\"800\" alt=\"\" class=\"slider-493 slide-497 msDefaultImage ml-lightbox-enabled\" title=\"Account Form Display\" \/><\/li>\n            <\/ul>\n        <\/div>\n        \n    <\/div>\n<\/div>\n\n\n\n<p>Voil\u00e0, users can now access their files from both the familiar Teams interface and within the corresponding Dynamics 365 account. While this solution works for connecting existing folders with records, it doesn\u2019t automate folder and document location creation for new accounts.<\/p>\n\n\n\n<p>If you&#8217;d like to streamline this further, there will be another post coming, where I&#8217;ll show you how to use Power Automate to automatically create standard folder structures in SharePoint for new accounts! In the meantime, take a look at <a href=\"https:\/\/linnzawwin.blogspot.com\/2021\/08\/automatically-create-sharepoint.html\" target=\"_blank\" rel=\"noreferrer noopener\">Linn Zaw Win&#8217;s blog post<\/a>, to get an idea of how to approach this.<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Imagine this: your team has built an efficient file organization system in Microsoft Teams, where each customer has their own dedicated folder within your general team channel. It\u2019s straightforward and ensures everyone can easily access the files they need.But when it&#8217;s time to link these folders to Dynamics 365, you&#8217;re faced with a dilemma: none&hellip;&nbsp;<a href=\"https:\/\/niklas-boesch.de\/en\/2024\/10\/integrating-dynamics-365-with-existing-microsoft-teams-file-structures\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Integrating Dynamics 365 with existing Microsoft Teams File Structures<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":480,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"[\"content\",\"tags\",\"comments\"]","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[14,17,16],"tags":[22,21,18,20],"class_list":["post-466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dataverse","category-integration","category-sharepoint","tag-dynamics-365","tag-integration","tag-sharepoint","tag-teams"],"featured_image_src":"https:\/\/niklas-boesch.de\/wp-content\/uploads\/2024\/10\/Playmobil-Cover.png","author_info":{"display_name":"Niklas B\u00f6sch","author_link":"https:\/\/niklas-boesch.de\/en\/author\/niklasboesch"},"_links":{"self":[{"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/posts\/466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/comments?post=466"}],"version-history":[{"count":18,"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/posts\/466\/revisions"}],"predecessor-version":[{"id":507,"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/posts\/466\/revisions\/507"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/media\/480"}],"wp:attachment":[{"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/media?parent=466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/categories?post=466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/niklas-boesch.de\/en\/wp-json\/wp\/v2\/tags?post=466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}