Lists
The Lists component allows you to interact with and automate tasks related to Microsoft SharePoint lists and items. It acts as a bridge between Nappai and your SharePoint environment, enabling you to manage data without writing complex code.
With this component, you can perform common actions such as:
- Create new lists or list items.
- Read existing data from lists.
- Update information in items.
- Delete items from lists.
- Search for specific data based on keywords.
- Bulk create multiple items at once for faster processing.
This component is ideal for building workflows that synchronize data, automate reporting, or manage tasks within SharePoint.
How it Works
The Lists component connects directly to the Microsoft SharePoint API. When you configure the component, you provide details like the SharePoint site and list you want to work with. The component then handles the communication with SharePoint based on the operation you select.
Internally, the component validates your inputs, constructs the appropriate request, and sends it to SharePoint. It receives the response and returns the results to your workflow. If you enable Mapping Mode, the component can also process complex data structures and map fields from other components dynamically.
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 Shared Point and fill in the required fields (Client ID, Client Secret, Tenant ID, and Microsoft Shared Point Scope).
- In your workflow, select the saved credential in the Credential input field of this node.
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 Site Lists: Retrieves the list of available lists in a SharePoint site.
- Create List: Creates a new list in a SharePoint site.
- Get List Items: Retrieves items from a specific list.
- Create List Item: Adds a new item to a list.
- Update List Item: Changes the data of an existing item.
- Delete List Item: Removes an item from a list.
- Bulk Create Items: Adds multiple items to a list at the same time.
- Search List Items: Finds items based on a search term.
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:
-
Bulk Items Data: List of dictionaries containing data for multiple list items.
- Visible in: Bulk Create Items
-
List Item Data: Fields data for list item operations (dictionary format).
- Visible in: Create List Item, Update List Item, Bulk Create Items
-
Operation: Defines the action to perform.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
-
Filter Query: OData filter query (e.g., fields/Title eq ‘Example’).
- Visible in: Get List Items, Search List Items
-
List Item ID: ID of the list item to update or delete.
- Visible in: Update List Item, Delete List Item
-
Items Count: Number of items to retrieve (default: 100).
- Visible in: Get Site Lists, Get List Items, Search List Items
-
List Description: Description for the new list.
- Visible in: Create List
-
List ID: SharePoint list ID.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
-
List Name: Name for new list or search term.
- Visible in: Create List
-
List Template: Template type for the new list.
- Visible in: Create List
-
Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
-
Search Query: Search term for list items.
- Visible in: Search List Items
-
Site ID: SharePoint site ID.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
-
Mode: Defines whether data is entered manually or selected from proposed options.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
-
Site: Select the SharePoint site to operate on.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
-
List: Select the SharePoint List to operate on.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
-
List Item: Select the SharePoint List Item to operate on.
- Visible in: Get Site Lists, Create List, Get List Items, Create List Item, Update List Item, Delete List Item, Bulk Create Items, Search List Items
Outputs
This component produces the following output:
- Data: The main result of the operation. Depending on the operation, this may contain a list of items, details of a created item, or confirmation of the action.
Output Data Example (JSON)json
{ “id”: “10”, “Title”: “New Task”, “Description”: “Automate this task using Nappai”, “Status”: “Active”, “CreatedDate”: “2023-10-27T10:00:00Z”, “AssignedTo”: “User Name” }
Connectivity
This component is typically used in the middle of a workflow. It usually follows a Trigger or a SharePoint connection node that provides site context. After this component executes, its Data output can be connected to components for data processing, notification, or further actions.
Common connections include:
- From: SharePoint Triggers, Data Sources, or Scheduling components.
- To: Data Transformation components, Email Notification components, or Database connectors.
Usage Example
Scenario: You want to add a new task to a “Project Tasks” list in SharePoint whenever a request is received.
- Operation: Select Create List Item.
- Site: Select your SharePoint site.
- List: Select “Project Tasks”.
- List Item Data: Provide the details for the new task, such as
{"Title": "Review Report", "Status": "Pending"}. - Run: The component creates the item and returns the new item’s data, which you can use to confirm success or send a notification.
Tips and Best Practices
- Always verify the Site ID and List ID before performing updates or deletions to prevent accidental changes.
- When using “Bulk Create Items”, ensure your data is formatted correctly to avoid errors.
- Use “Mapping Mode” only if you need to map fields from other components dynamically.
- Check the “Data” output to see the results of your operations in the next steps.
- Be cautious with delete operations, as they cannot be undone.
Security Considerations
- Keep your SharePoint credentials secure and do not share them.
- Be careful when deleting items, as this action cannot be undone.
- Use encryption for sensitive data stored in SharePoint.
Important Notes
🔒 Protect Sensitive Data 🔴 SharePoint list operations expose data to the network. Ensure your credentials are stored securely and use encrypted connections to protect sensitive information.
⚠️ Component is in Development 🟡 This component is flagged as ‘is_development’, meaning it may contain bugs or incomplete features. Unexpected behavior or errors could occur during use.
📋 Valid SharePoint Credentials Required 🔴 To use this component you must provide valid Microsoft SharePoint authentication credentials and the URL of the SharePoint site you want to manage.
💡 Use Specific List Names 🟢 When creating, updating, or deleting lists, specify the exact list name to avoid affecting unintended lists. This reduces the risk of accidental data loss.
⚙️ Enable Mapping Mode Carefully 🟢 The component’s ‘mapping_mode’ flag allows field mappings between your system and SharePoint. Ensure your mapping configuration is correct, as incorrect mappings can cause data mismatch.
ℹ️ Delete Operations Are Irreversible 🟡 When you delete a SharePoint list, the data is permanently removed and cannot be recovered through this component. Double‑check before executing delete actions.