SharePointSitesComponent
This component helps you interact with Microsoft SharePoint sites inside your Nappai automations. You can search for specific sites, pull detailed information about a site using its ID or name, or retrieve associated file drives. It acts as a friendly bridge between your workflow and SharePoint’s cloud services, making it simple to automate site management and data retrieval tasks without needing to write code.
How it Works
This component connects to Microsoft SharePoint using secure cloud APIs. When you run a workflow, it sends a request to SharePoint using the credentials you provided. Depending on the operation you choose, it either searches for sites based on keywords, fetches details of a specific site, or returns related drives. SharePoint processes the request and sends back the data. The component then formats this information into a clear, structured list that you can easily pass to the next step in your automation.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type Microsoft SharePoint and fill in the required fields (Client ID, Client Secret, Tenant ID, and Microsoft SharePoint Scope).
- In your workflow, select the saved credential in the Credential input field of this node.
Note: You can configure your Microsoft SharePoint credentials in Microsoft Entra.
Operations
This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:
- Get All Sites: Retrieves a complete list of all SharePoint sites you have access to.
- Search Sites: Finds SharePoint sites based on a keyword, title, or URL you provide.
- Get Site by ID or Name: Fetches detailed information for a specific site using its unique identifier or display name.
- Get Root Site: Locates and returns the main root site of your SharePoint tenant.
- Get Site Drives: Retrieves the list of file drives (OneDrive/SharePoint) associated with a specific site.
To use the component, first select the operation you need in the “Operation” field.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
- Operation: Selects the action the component should perform.
- Visible in: Get All Sites, Search Sites, Get Site by ID or Name, Get Root Site, Get Site Drives
- Hostname: The domain name of your SharePoint tenant (e.g., company.sharepoint.com).
- Visible in: Get Site by ID or Name
- Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Visible in: Get All Sites, Search Sites, Get Site by ID or Name, Get Root Site, Get Site Drives
- Results Count: The maximum number of results to return (default: 50).
- Visible in: Get All Sites, Search Sites, Get Site by ID or Name
- Search Query: A search term to find SharePoint sites. Use plain keywords or structured queries.
- Visible in: Search Sites, Get Site by ID or Name
- Site ID or Name: The unique ID or display name of the SharePoint site.
- Visible in: Get Site by ID or Name, Get Site Drives
- Site Path: The relative path of the SharePoint site (e.g., /sites/teamsite).
- Visible in: Get Site by ID or Name
Outputs
When the component runs successfully, it outputs structured site data that can be used in subsequent steps of your automation. You can map this output to filters, notifications, or other site management tools to continue your workflow.
Output Data Example (JSON)json
{ “sites”: [ { “id”: “550f3646-1d90-4f80-a5f2-583192e6f2b1”, “name”: “Marketing Hub”, “url”: “https://contoso.sharepoint.com/sites/Marketing”, “displayName”: “Marketing”, “hasRootSite”: true, “description”: “Central hub for all marketing campaigns and reports.” } ], “operation_status”: “success”, “error_details”: "" }
Connectivity
This component is typically used at the beginning or middle of a data extraction workflow. Its output naturally flows into other tools like data transformers, approval nodes, or notification systems. For example, you can connect the returned site list to a loop component to process each site individually, or pass specific site details to a file management component. It works best when linked with downstream SharePoint tools like SharePointListsComponent or SharePointFilesComponent to continue automating site-related tasks.
Usage Example
Scenario: Automating the retrieval of department-specific SharePoint sites for weekly reporting.
- Add the SharePointSitesComponent to your workflow and set Operation to Search Sites.
- In the Search Query field, enter a keyword like
financeor a structured query likedisplayName:Finance. - Set Results Count to
10to limit the list size and improve speed. - Run the workflow. The component will return a list of matching sites. You can then map the output Data to a subsequent component to send email notifications, log the results, or update records based on the found sites.
Important Notes
🔒 Deletion Requires Careful Permission Checks 🔴 The delete operation permanently removes a site and all its content. Verify that you have appropriate permissions and have performed backups before executing delete actions.
⚠️ Component in Development 🟡 SharePointSitesComponent is marked as development. Some functions may be incomplete, unstable, or behave unexpectedly. Use with caution and test thoroughly before production deployment.
📋 Microsoft SharePoint Credentials Needed 🟡 To use this component you must provide valid SharePoint credentials (e.g., OAuth token) and have API permissions that allow site retrieval, update, and deletion.
💡 Use Specific Queries for Retrieval 🟢 When retrieving sites, include specific filters or query parameters instead of broad requests. This reduces load on SharePoint and speeds up response times.
🛠️ Ensure Proper Field Mapping 🟡 When configuring the component, double‑check that all required fields are mapped correctly. Mismatches can cause failures during site update or delete operations.
ℹ️ Mapping Mode Is Enabled by Default 🟢 The component operates in mapping mode, meaning it expects input fields to be explicitly mapped to SharePoint field names. Incorrect mapping may lead to errors or incomplete updates.
Tips and Best Practices
- Always test your workflows in a development environment before deploying to production.
- Use exact site names or IDs whenever possible to avoid retrieving unintended data.
- Keep your search queries specific to improve workflow performance and stay within API limits.
- Verify site permissions with your IT administrator before attempting updates or deletions.
Security Considerations
This component interacts with sensitive cloud data. Ensure that your Microsoft SharePoint credentials are stored securely and restricted to least-privilege access. Avoid sharing workflow outputs containing site URLs or identifiers in public channels. Regularly review API permissions to maintain compliance with your organization’s data security policies. When using operations that modify or remove data, always implement safety checks or require manual approval to prevent accidental data loss.