In this article
Overview
SharePoint Online - Get Sites is a Read-type Snap that allows you to get the list of sites specific to the logged-in user from the SharePoint Online site. You can also:
Retrieve specific metadata information of a specific site.
Retrieve the sub-sites of the selected site. (Optional)
For more information about how to get the metadata of an item in the SharePoint Online, refer to the list-document-library in Graph API documentation.
Prerequisites
Valid SharePoint Online tenant and associated site.
Valid application in Azure portal with all the required API permissions.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Limitations and Known Issues
None.
Snap Views
View Type | View Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| A document containing the metadata information that needs to get the document library metadata. |
Output | Document |
|
| A document containing the metadata of the document library or a complete list of document libraries in the mentioned site. |
Error | Document |
| N/A | The error view contains error, reason, resolution and stack trace. For more information, see Handling Errors with an Error Pipeline. |
Snap Settings
Field names marked with an asterisk ( * ) are mandatory.
Field Name | Field Type | Field Dependency | Description | Default Value | Example |
---|---|---|---|---|---|
Label* | String | N/A | Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline. | N/A | SharePoint Online - Get Sites |
Site | String/Expression/Suggestion | Enables Enumerate subsites checkbox. | Specify the name of a site to get the metadata information. | N/A | MySite |
Enumerate subsites | Checkbox | Enabled when you specify or select a value in the Site field. | Select this checkbox to get a collection of subsites available for a site. | Not selected | N/A |
Search query* | String/Expression | Enabled when you select the Enumerate subsites checkbox. | Specify keywords that match with one or more site names, as needed. The Snap searches and returns matching sites. This field is hidden if you select a specific site to retrieve the metadata information. | * | micro* dev AND (performance OR process) NOT sales |
Top | Integer/Expression | Enabled when you select the Enumerate subsites checkbox. | Specify the number of records to be read from the matched search results. | 200 | 500 |
Auto pagination | Checkbox | N/A | Select this checkbox to retrieve all matching site names as a paginated list. If you select the Auto Pagination checkbox, the Top field is hidden. | Not selected | Selected |
Connection details | Use this field set to define connection parameters to access SharePoint Online. This field set contains the following fields:
| ||||
Connection timeout* | Integer | N/A | Specify the connection timeout duration in seconds. | 30 | 30 |
Number of retries* | Integer | N/A | Specify the maximum number of retries in case of connection failure or timeout. | 1 | 3 |
Retry interval (seconds)* | Integer | N/A | Specify the time interval in seconds between connection attempts. | 0 | 10 |
Snap Execution | Dropdown list | N/A | Select one of the three modes in which the Snap executes. Available options are:
| Execute only | Validate & Execute |
Troubleshooting
Error | Reason | Resolution |
---|---|---|
Site name {siteName} is not found in the tenant. | The site name that you have entered is not available in the tenant. | Click the Suggestion icon and select the site or enter a valid site name manually. |
Forbidden exception. | Either the user or the app does not have sufficient permissions to read the metadata for the document library. | Ensure that you provide both user-level and app-level permissions required to access the metadata. |
Example
Retrieving Sites List
This example demonstrates how to retrieve the list of sites of a user who is authenticated while creating the account. This example assumes that you have configured and authorized a valid account for the SharePoint Online - Get Sites Snap. For more information about configuring account, see SharePoint Online Account.
First, we configure the SharePoint Online - Get Sites Snap as follows to get the list of sites. We leave the default values as is.
After successfully validating the Pipeline, the Snap gets all the sites from SharePoint Online and displays the first 200 matching sites in the page.
Next, we connect the JSON Formatter Snap to format the output into a JSON file, and finally write the file to the database using the File Writer Snap.
Downloads
Important Steps to Successfully Reuse Pipelines
Download and import the Pipeline into SnapLogic.
Configure Snap accounts as applicable.
Furnish Pipeline parameters as applicable.
Snap Pack History
See Also
SharePoint Online - Upload File