Sharepoint

Warning

This data source is deprecated and not available for use. This document remains viewable for legacy support and archival purposes.

If necessary, consider connecting to this service using a REST data source instead.

The SharePoint data source type allows end 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 SFX users.

Warning

Sharepoint connections are not supported when using Skuid SFX 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

First, ensure you have a SharePoint Online instance that is accessible online via a URL such as https://<CompanyName>.sharepoint.com, (where <CompanyName> is your SharePoint Online company name).

In Azure Active Directory

Configure an Azure Active Directory (AD) app registration and configure its API permissions.

Within the SharePoint API section, select the following:

  • AllSites.Write - Read and write items in all site collections

Depending on your permission policies, you may alternatively wish to select AllSites.Read AllSites.Manage or even AllSites.FullControl

In Skuid

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 Azure AD app registration’s client ID (see the previous section).

    • Client Secret: Enter the Azure AD app registration’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 SFX users.

To use the Sharepoint_SharedLogin authentication provider, you must save at least one set of Sharepoint username and password credentials within Skuid.

After saving these credentials, complete the following steps:

  1. Decide on a credentialing option
  2. Create the SharePoint data source
  3. 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 end 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 external 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.

Using Sharepoint with the File Upload Component

You may use the File Upload File Upload Component to upload files to SharePoint. If you select a Sharepoint model for your File Upload Data Source Type, the following fields will appear:

  • File Storage Location: relative_server_url
    • This default value simply means files will be sent to the URL specified during data source configuration. This value the cannot be changed.
  • Label: Entering a label will insert custom text for the upload button. Leaving this field blank will result in a button that simply says Upload.
  • File Name: Use this field to rename any files uploaded through the file component.
    • This field is compatible with Merge Syntax.
    • If this field is blank, files will retain their original name.
  • Relative folder URL: The parameter Skuid will append to the File Storage location URL.
  • Update Metadata: Specify what, if any, metadata values will be sent to SharePoint along with the uploaded file. These values will update column records in the Sharepoint folder set as the storage location. Column values are updated by name-value pairs, which are separated by a colon and then delimited with a comma.

For example, if your SharePoint folder has an OpportunityName and RecordID column, inserting "OpportunityName:KrakenConsulting, RecordID:0001" into this field would update the OpportunityName column record for the uploaded file to KrakenConsulting and the RecordId column record to 0001.

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 end user if an attempt is made. If using this action type in a row action, use display logic to display the action when Size != 0, as folders do not have a file size in Sharepoint.

Troubleshooting

I’m having issues connecting to my instance [[]]

  • If using OAuth to connect to Sharepoint, verify that the authentication provider is properly configured.

    Most importantly—even if the Company Name and Site Collection path properties have been set—ensure that the <Company Name> and <Site Collection Path>``values have been updated in the **authorize endpoint URL** and the ``<Company Name> value has been updated in the token endpoint URL.

  • If issues continue, try creating a remote site setting for https://<Company Name>.sharepoint.com/_api/$metadata, where <Company Name> matches the name of your organization.

Nothing appears when I try to select a model object [[]]

Verify that the Permission Request XML has been updated in your Sharepoint app registration.

General debugging [[]]