DXP
Digital Experience Platform Squiz Marketplace

Supercharge your Squiz DXP with components, templates, extensions, and more.

Multiple use cases for Matrix & Sharepoint (Office 365)

A range of the most common Matrix and Sharepoint use cases in a single recipe - just delete what you don’t need

Implement this recipe to enable some of the key Matrix / Sharepoint use cases. It’s easy to delete flows for use-case you don’t need, and you can customise flows if you have additional requirements.

  • Display a curated list of documents on a Matrix page based a Sharepoint workflow
  • Search and display the contents of a Sharepoint site as a hierarchical structure on a Matrix page
  • Submit a file attachment from Matrix form and store in a specified Sharepoint document folder according to your workflow

Sharepoint Matrix multiple flows

It’s easy to integrate using a Recipe. All you need is the right credentials to connect. We recommend you test the integration with a Sandbox account before using it in production.

  1. Click the Activate recipe button to deploy this Recipe in Squiz Connect.
  2. Sign into Squiz Connect if you’re not already signed in.
  3. Follow the on screen instructions to finish deploying the Recipe.

Setting up the integration

There are 2 key steps to setting up this integration - both of which are explained in greater detail below:

  1. Configure Microsoft Azure App registration to get the credentials for Sharepoint
  2. Activate the recipe in Connect, and update the flows to connect to your selected Sharepoint site

Getting the Sharepoint credentials and adding them to Connect

1. Go to your Microsoft Azure portal and click on App registrations to setup a Connect app

App registrations

2. Choose New registration to create a new registration for your connect recipe

app registration

3.Record the Application (Client) ID, this value is required when adding the Sharepoint credentials to Connect

app registration step 2

4. Open Certificates & secrets page using the the left hand navigation, and choose  New client secret. Record the value once the secret is created as the value only displays on the screen when the secret is created.  This value is required when adding the Sharepoint credentials to Connect.

app registration step 3

5. Now you have both Client ID and Client secret details from the Step 3 and 4, the auth URI and token URI required for the credential should follow the format below:

AUTH URI: 
https://login.microsoftonline.com/{REPLACE_THIS_VALUE_WITH_YOUR_SHAREPOINT_URL}/oauth2/v2.0/authorize
TOKEN URI:
https://login.microsoftonline.com/{REPLACE_THIS_VALUE_WITH_YOUR_SHAREPOINT_URL}/oauth2/v2.0/tokenA sample of credential page.

6.  Log into Connect and open the workspace where you will set up your flows. Add the Sharepoint credentials as follows.

sharepoint credential

6. Click on Authenticate button, it will validate the credentials and the button turns green once it 's validated. Then click Save button to store the credential.

Set up flows to connect to your selected Sharepoint site

Once you have activated the recipe, review the flows that have been created and delete any flows you don't need. For the flows you do need, you can now edit them to point tp the correct Sharepoint site.

Details including the sample data structure for flows of the recipe can be found below.

  1. Sharepoint - Receive documents from a folder
  2. Sharepoint - Search site items from a folder
  3. Sharepoint - Upload the file to a folder

Sharepoint - Receive documents from a folder

1. The first step of the flow is a webhook step which expects the POST data in the following JSON format.

A sample with default value:

{
 "path": "",
 "folderId": "",
 "options": {
   "orderBy": "",
   "select": "",
   "top": "",
   "skipToken": ""
  }
}

A sample with optional parameters:

{
 "path": "",
 "folderId": "root",
 "options": {
   "orderBy": "name desc",
   "select": "name,id,webUrl",
   "top": "50",
   "skipToken": ""
  }
} 

2. Go to the Sharepoint step to select the Site Identity. The dropdown list shows the sample Sharepoint sites from the recipe. Click the reload icon to refresh the list from your Sharepoint instance.

sharepoint connector

Sharepoint - Search site items from a folder

1. The first step of the flow is a webhook step which expects the POST data in the following JSON format.

{
  "folderId": "root",
  "options": {
    "search": "document"
  }
}

2.  Go to the Sharepoint step to select the Site Identity. The dropdown list shows the sample Sharepoint sites from the recipe. Click the reload icon to refresh the list from your Sharepoint instance. After reloading the site identity, the dropdown list will show all Sharepoint sites that the Sharepoint credential has permission to access.

sharepoint search input

Sharepoint - Upload a file to a folder

1. The first step of the flow is a webhook step which expects the POST data in the following JSON format.

curl --location --request POST '{Connect flow url}' \
--form 'file=@"{file location/url}"'
Code example from Postman:
curl --location --request POST 'https://in.connect.squiz.cloud/hook/6029c3dececfd7001247c7e6' \
--header 'Cookie: INGRESSCOOKIE=cc6c892461e215c0c193609a4f518512' \
--form 'file=@"/Users/chan/Uploads/file-attachment.png"'
 

2. Go to the Sharepoint step to select the Site Identity. The dropdown list will show all Sharepoint sites that the Sharepoint credential has permission to access.

3. Then specify the folder location in the path for the file to be loaded to

sharepoint connector file

TypeRecipe
For  Squiz Connect
Flows 3
  Documentation