Sharepoint

The SharePoint data source type allows users to access and manipulate files and data stored in a Sharepoint Online instance. While similar to OneDrive, Sharepoint is intended for team collaboration and communication while working on a project. For more information on the differences between OneDrive and Sharepoint, see Microsoft documentation.

When configuring a connection to your Sharepoint instance, there are two different authentication mechanisms to choose from:

  • Using an OAuth 2.0 authentication provider

  • Using the SharePoint_SharedLogin custom authentication provider

    Note

    This method is only available to Skuid on Salesforce users.

Warning

Sharepoint connections are not supported when using Skuid on Salesforce in Lightning.

Connect Using OAuth 2.0 Authentication

To connect to SharePoint using OAuth2.0, you’ll need to complete three steps:

  • Create a SharePoint app
  • Create the SharePoint authentication provider
  • Create the SharePoint data source

Prerequisites

  • A SharePoint Online instance, accessible online via a URL such as https://<CompanyName>.sharepoint.com, (where <CompanyName> is your SharePoint Online company name).

  • The app domain for your Skuid site.

    • For Skuid Platform:
      • Use the base URL for your Skuid site: example.skuidsite.com.
    • For Skuid on Salesforce:
      1. Use the Salesforce App Menu to navigate to the Skuid app, and click it.
      2. In the Skuid app, copy the URL.
      3. Remove everything from /apex onwards.
  • The redirect URI for your Skuid site.

    Skuid Platform [[]]

    For Skuid Platform sites, simply append /auth/oauth/callback to your Skuid site’s domain URL.

    Some examples:

    • For https://example-us-trial.skuidsite.com/, use https://example-us-trial.skuidsite.com/auth/oauth/callback
    • For https://gui-construction.skuidsite.com/, use https://gui-construction.skuidsite.com/auth/oauth/callback
    • For https://asgard-talent-management.skuidsite.com/, use https://asgard-talent-management.skuidsite.com/auth/oauth/callback

    Skuid on Salesforce [[]]

    When using Skuid on Salesforce, the callback URL will depend on several things:

    • Whether or not the Remove Instance Names from URLs critical update is activated
      • If the above critical update is not activated, then the Salesforce org’s instance
    • If set, the Salesforce org’s My Domain
    • Whether the org is a developer edition or sandbox org

    Each of these variables will change parts of the callback URL.

    Note

    Lightning Experience requires that My Domain be enabled.

    There are also different URLs needed based on whether the Skuid page is deployed using the Redirect, the skuid:page Visualforce component override method, or the Skuid Page Lightning component. Because of this, it’s best to enter all callback URLs for Skuid on Salesforce orgs within your OAuth applications.

    To ensure the accuracy of your callback URLs, fill out the form below to generate the appropriate Salesforce callback URLs for your org:

In SharePoint

Create a SharePoint App / OAuth client

In order for Skuid to connect to SharePoint Online using OAuth 2.0, you must register a SharePoint Online “App”, which is a named OAuth Client.

  1. Login to your SharePoint Online account.

  2. Navigate to the Register an App page at https://<CompanyName>.sharepoint.com/_layouts/15/appregnew.aspx (where <CompanyName> is your SharePoint Online company name).

    • For example, if the company name is Acme, the location would be:

      https://acme.sharepoint.com/_layouts/15/appregnew.aspx

  3. Client Id: Click Generate.

  4. Client Secret: Click Generate.

    Note

    Copy the generated client Id and secret and store in a secure place. You’ll need them later in this process.

  5. Title: Use a name that is descriptive.

  6. App Domain: Use the app domain as noted in the Prerequisites section.

  7. Redirect URI: Use the redirect URI as noted in the Prerequisites section.

  8. Click Create.

Edit the App Permissions

Next, edit the SharePoint App’s permissions to define the client’s access to the SharePoint Online instance.

  1. Navigate to

    https://<CompanyName>.sharepoint.com/_layouts/15/appinv.aspx, and make the following edits:

    • App ID: Enter the App’s Client Id (previous section, Step 3) into the App Id field.

      • Click Lookup to search for the App in the SharePoint Online instance’s registered apps.
      • Select the app.
    • Permission Request XML: This XML determines the permissions for your Sharepoint app. Refer to Microsoft documentation to properly determine the best permissions settings for your app.

      The examples below will assume the following Permission Request XML:

      <AppPermissionRequests>
      <AppPermissionRequest
      Scope="http://sharepoint/content/sitecollection"
      Right="Write" />
      </AppPermissionRequests>
      

    Note

    You may want to change the “Write” in Right=”Write” to one of the following:

    • Read
    • Write
    • Manage
    • Full Control
  2. Click Create to apply these changes to your App.

  3. If presented with a “Do you trust …?” screen, click Trust It.

In Skuid

Create an authentication provider that uses the SharePoint app’s client ID and secret.

Create an authentication provider

  1. Navigate to Configure > Data Sources > Authentication Providers.

  2. Click New Authentication Provider.

  3. Fill out the necessary fields:

    • Name: Enter a unique name, such as SharePoint_Auth

    • Authentication Method: OAuth 2.0 / OpenID

    • Provider Type: SharePoint Online

    • Grant Type: Authorization Code

    • Company Name: Your SharePoint Online Company Name.

    • Site Collection Path: Depending on the company’s SharePoint Online setup, it may be necessary to indicate the site collection path.

      Note

      Entering Company Name (and, if required, Site Collection Path) will auto-populate the following fields:

      • The Authorize and Token Endpoint URLs
      • Token Request Body Parameters
    • Client ID: Enter the Sharepoint app’s client ID (see the previous section).

    • Client Secret: Enter the Sharepoint app’s client secret (see the previous section.

  4. Click Save.

  5. If asked to create Remote Site Settings, click OK.

Create a data source

With the authentication provider configured, create a data source that uses it to authenticate and gain access to SharePoint data.

  1. Navigate to Configure > Data Sources > New Data Sources.
  2. Click New Data Source.
  3. Select the SharePoint data source type.
  4. Enter a unique name for your data source, such as SharePointOnline.
  5. Click Next Step.
  6. Enter the required information as noted below:
    • URL/Endpoint: https://<CompanyName>.sharepoint.com/_api where <CompanyName> is your SharePoint Online company name.
    • OData Version: 3
    • Check Use Proxy / Use Apex Proxy.
    • Authentication Method: Authentication Provider
      • Authentication Provider: Select the authentication provider you created in the previous section.
  7. Click Save.
  8. If Skuid asks to create a Remote Site Setting, click OK.

You can now use your SharePoint data source within a model on a Skuid page.

Connect using the Sharepoint__SharedLogin authentication provider

Note

This authentication option is only available for Skuid on Salesforce users.

To use the Sharepoint_SharedLogin authentication provider, you must save at least one set of Sharepoint username and password credentials within Skuid. There are three credential options (see below); choose the one that best suits the security and permission set needs of your team.

To connect to SharePoint using OAuth, you’ll need to complete three steps:

  • Decide on a credentialing option
  • Create the SharePoint data source with
  • Create a Remote Site setting for the SharePoint instance

Credential Options

Before creating the data source type, decide on the type of credentialing the data source will use.

Shared: Org-Wide credentials

With this option, all users share a single Sharepoint login.

Warning

This option is not recommended unless all Skuid users have equal permissions for all data in the SharePoint instance.

Shared: Per-Profile credentials

If you have properly assigned data source profiles and permissions and would prefer to have logins shared by those profiles, select Shared: Per-Profile, with optional Org-Wide Default option.

Create a data source

  1. Navigate to Configure > Data Sources > New Data Sources.
  2. Click New Data Source.
  3. Select the SharePoint data source type.
  4. Enter a unique name for your data source, such as SharePointOnline.
  5. Click Next Step.
  6. Enter the URL of the Sharepoint database that allows API access. This should be similar to https://<CompanyName>.sharepoint.com/_api where <CompanyName> is your SharePoint Online company name.
  7. Check Use Apex Proxy.
  8. For Authentication:
    • Authentication Method: Authentication Provider (OAuth, Custom, etc)
    • Authentication Provider: SharePoint_SharedLogin.
  9. Credential Source: (See the previous section for details on these options)
    • Shared: Org-Wide
    • Shared: Per-Profile, with optional Org-wide Default
    • Per-User, with optional Profile / Org-wide Defaults

Once the Credential Source is selected, two new fields open. If using Shared: Org Wide, or using the option Org-wide default for the other two options, enter the following information:

  • Org-wide default username

  • Org-wide default password

    Note

    These credentials will NOT be visible or accessible to Skuid page users, but Skuid will use these credentials to authenticate users when making requests to SharePoint Online.

  1. Click Save.
  2. Skuid will ask to create a Remote Site Setting. Click OK.

Remote Site Settings

Skuid automatically created the Remote Site Setting for the actual Sharepoint instance (see Step 11, above); you must manually setup a Remote Site Setting for the Microsoft login URL that Skuid uses to authenticate to SharePoint Online.

In Salesforce Setup:

  1. Navigate to Security Controls > Remote Site Settings.
  2. Click New Remote Site.
  3. Give the Remote Site a descriptive name (something like “Skuid_Sharepoint_SharedLogin”).
  4. For the Remote Site URL, enter https://login.microsoftonline.com.
  5. Click Save.

If using Shared: Per-Profile credentials

After saving the data source and creating the Remote Site settings, find the data source in the list of data sources (Configure > Data Sources) and click Advanced Settings next to the SharePoint data source.

  1. Click Profile Credentials in the top right of the configuration area.
  2. Click fa-plus-circle Add to create new credential sets with the following fields:
    • Applies to: Select from the picklist.
    • Username
    • Password

Using the Sharepoint Data Source Type

After configuring your authentication and data source settings, you can create models that reference Sharepoint objects.

In a Skuid page, click fa-plus-circle Add Model to create a new model, then edit the model:

  • Name: Give the model a name
  • Data Source Type: Sharepoint.
  • Data Source: Select the data source that points to your Sharepoint database.

If using OAuth authentication [[]]

At the first use of this data source, Skuid opens a popup asking you to log into the Sharepoint app. Once logged in, SharePoint will display a screen asking, “Do you trust [the Skuid Sharepoint app title]?” Click Trust It.

When this is complete, the SharePoint object list will populate allowing you to select SharePoint exaternal objects.

Warning

The browser may block this popup. In Google Chrome‚ for instance, a red X and a window icon appears in the URL bar.

  1. Click on the icon, and then click Always allow popups from…

  2. Click Done.

  3. Click on this icon again, then click on the link that was blocked to open it up.

    Other browsers will have similar processes to unblock popups.

  4. Select the SharePoint External Object from the picklist.

    • Model Label and Model Plural Label fields: enter appropriate labels.
  5. Add Fields and Conditions, etc. to the model, as needed. Click Save.

  6. Save and then Preview the page.

You can now use your SharePoint data source within a model on a Skuid page.

Data Source Actions

  • Download File: Commonly used as a row action with the SP.Files entity, this action downloads a file.
    • File URL (Required): The URL Skuid uses to download files. Accepts merge syntax. In most use cases, this value should be {{Url}}.

Note

  • Ensure that your SP.Files model is pulling in the Url field.
  • Folders cannot be downloaded and will deliver an error page to the user if an attempt is made. If using this action type in a row action, use conditional rendering to display the action when Size != 0, as folders do not have a file size in Sharepoint.

Troubleshooting