Connecting a ShortPoint element to a SharePoint Document Library is a simple task. But what if you want to connect the element to a folder inside the Document Library to show the files contained there? Like this one:
To complete the task, we will be using the REST API connection type. Please follow the steps below.
Step 1. Insert a ShortPoint element.
In the edit mode of the page, press the ShortPoint Insert button on the top to open the Page Builder:
For this example, we will be using a Simple List - but as always, feel free to choose any element that you want.
Choose the Simple List element from the Page Builder grid:
The settings of the element will open.
Step 2. Build your REST API link.
Here is the URL we will use:
https://site url/_api/web/GetFolderByServerRelativeUrl('Document Library Name/Target Folder Name')/Files
here, you need to substitute the items highlighted with red, with your actual website url, document library name and folder name.
For example, here is how my URL looks like:
https://mycompany.sharepoint.com/_api/web/GetFolderByServerRelativeUrl('/Document Library with Folders/Target Folder')/Files
- mycompany.sharepoint.com is the URL of my site;
- Document Library with Folders is the name of my Document Library;
- and Target Folder is the name of the folder inside the Document Library to which I want to connect.
Step 3. Connect.
Switch to the Connect tab of the element settings:
From the Select Connection Type drop-down, select REST API:
Paste the URL you have created in Step 2 into the REST API URL field and press the green Connect button:
Step 4. Map the Items.
Switch to Items tab.
Here, by using the chain icon button, select the columns of the list that you would like to display. For more information please check our article: ShortPoint Connect: Basic Tutorial.
Here is an example of Items Mapping:
Here is what the result will look like:
Here are some related articles: