ecLearn - Learning Management System built on top of Microsoft Dataverse for Power Platform and Dynamics 365 users

ENGINEERED CODE BLOG

Adding SharePoint Integration to the Employee Self-Service Portal Without Server-side Code – Part 1

In this series I’m going to step through how you can add an integration with SharePoint to the Employee Self-Service Portal in Dynamics 365 without using server-side code. While the recent news that the October ’18 release of the Portal capabilities for Dynamics 365 will include out-of-the-box SharePoint integration may make this series obsolete in a hurry, I’m sharing it as it might inspire other solutions that can leverage the same techniques.

Why the Employee Self-Service Portal?

In order to interact with SharePoint without using server-side code, we’re going to use the SharePoint REST API and call it directly from JavaScript on our portal. Obviously SharePoint requires that these requests be authenticated – anonymous users don’t have access to use the SharePoint REST API.

While, in theory, we could hard-code credentials into our JavaScript, this would be bad practice. Therefore, we want to leverage the user’s existing session to allow us to access SharePoint. This only works if the user is logged in via Azure AD, with a user account that has SharePoint privileges.

So, if we’re assuming that the user has to use Azure AD to log into the portal, this means the most likely scenario is that you’re implementing employee self-service.

To be clear, there is no reason you couldn’t use this technique on any of the portals, as long as you’re using Azure AD for authentication. You could also, in theory, only show the SharePoint integration pieces if the user is logged in to Azure AD, and hide it for everyone else. But I’m not going to explore that in this series.

Our Sample Scenario and Prerequisites

In this series, we’re going to add the ability to view SharePoint documents related to a case as exposed in the Employee Self-Service Help Desk.

Let’s assume:

  1. You’ve created a SharePoint site, enabled the out-of-the-box SharePoint integration with Dynamics 365, and selected the Case entity as being enabled for Document Management.
  2. You’ve provisioned an Employee Self-Service Portal and are able to login to the portal with a user that also has permissions to SharePoint site used in the integration.

High Level Steps

The technique involves the following steps, which I’ll describe in upcoming posts:

  1. Use FetchXML and Liquid to determine the SharePoint folder for current entity
  2. Use the SharePoint REST API to display a list of documents in the SharePoint folder related to the current entity
  3. Bonus: Use the SharePoint REST API to upload a new document to the SharePoint folder

6 responses to “Adding SharePoint Integration to the Employee Self-Service Portal Without Server-side Code – Part 1”

  1. […] post Adding SharePoint Integration to the Employee Self-Service Portal Without Server-side Code – P… appeared first on Engineered […]

  2. […] my third post in the series on how you can add an integration with SharePoint to the Employee Self-Service Portal in Dynamics […]

  3. […] my third post in the series on how you can add an integration with SharePoint to the Employee Self-Service Portal in Dynamics […]

  4. […] my fourth and final post in the series on how you can add an integration with SharePoint to the Employee Self-Service Portal in Dynamics […]

  5. […] my fourth and final post in the series on how you can add an integration with SharePoint to the Employee Self-Service Portal in Dynamics […]

  6. Arunav says:

    my requirement is there is a custom page developed in powerapps portal once user upload a file it will be added in sharepoint folder and when user deletes a file in portal file gets deleted from sharepoint folder

    when user upload file then that file should be retrieved so that there is a hyperlink which will show shrepoint file once user hits file should be downloaded

Leave a Reply

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

Contact

Engineered Code is a web application development firm and Microsoft Partner specializing in web portals backed by Dynamics 365 & Power Platform. Led by a professional engineer, our team of technology experts are based in Regina, Saskatchewan, Canada.