SharePoint Item Actions (Beta)

Estimated reading: 10 minutes

The SharePoint Item Actions component allows users to manage SharePoint files and folders through a single component. It supports uploading, downloading, checking whether an item exists, moving, copying, and deleting files or folders.

The component accepts a SharePoint path or full URL as the input location and resolves the specified location based on the provided input and configuration.

Prerequisites

Before using the SharePoint Item Actions component, ensure that:

a. Microsoft 365 is configured through App Integration in Robility Manager.
b. A valid Authentication Token is available for accessing Microsoft Graph and SharePoint. Refer to App Integration Token for token retrieval.
c. The configured account has the required permissions to perform the selected operation.
d. The SharePoint site, document library, and source or destination locations are accessible to the configured account.

Operation-Specific Input Requirements

The required inputs depend on the selected operation.

Operation Description
CheckExists Checks whether the specified file or folder exists in SharePoint.
UploadFile Uploads a file from a supported local or server-side location, or from Base64-encoded content, to SharePoint.
Download Downloads a specified SharePoint file or folder. Folder downloads are subject to the configured file-count limit and applicable size restriction.
Move Moves a file or folder to the specified destination.
Copy Copies a file or folder to the specified destination while preserving the original item.
Delete Deletes the specified SharePoint file or folder.

Note: Enable Allow Destructive Actions to permit operations that modify or remove existing SharePoint items, including Move and Delete. Ensure that the configured account has the required permissions.

Parameters

Parameter Description
Operation* Specifies the SharePoint operation to perform: CheckExists, UploadFile, Download, Move, Copy, or Delete.
Authentication Token* Specifies the authentication token required to access Microsoft Graph and SharePoint. Configure Microsoft 365 through App Integration in Robility Manager and use the App Integration Token component to obtain the token.
Input Location Specifies the source file or folder in SharePoint. Enter a SharePoint path or a full SharePoint URL. The location is used by operations such as CheckExists, Download, Move, Copy, and Delete.
Destination Location Specifies the destination folder in SharePoint where a file or folder will be uploaded, moved, or copied. Provide a SharePoint folder path or the full URL of the destination folder.
File Paths (Data/DataFrame) Connects a Data or DataFrame node containing the file paths to upload to SharePoint. This parameter applies to the UploadFile operation.
File Paths (Select Files) Allows you to select or upload files directly. This parameter applies to the UploadFile operation.
File Path Specifies the local file path for uploading a file from the Robility File Manager to SharePoint. This parameter applies to the UploadFile operation.
Content (Base64) Specifies the Base64-encoded string of the file content to upload to SharePoint. Use this parameter when uploading file content as a Base64 string instead of providing a file path.
Default Drive ID Specifies the Drive ID of the SharePoint document library used to identify the input or destination location when required. Leave this field blank when using a full SharePoint URL or a supported path that the component can resolve automatically.
Max Folder Download File Count Specifies the maximum number of files that can be downloaded in a single folder download. The default is 100 files. Set this value to 0 to remove the file-count limit.
Rename on Conflict Determines how the component handles a file with the same name at the destination. When enabled, the incoming file is renamed to avoid a conflict. When disabled, the existing file is overwritten.
New Name Specifies the new name for the destination item when moving or copying a file or folder in SharePoint. This parameter applies to the Move and Copy operations.
Create Destination If Missing Determines whether the component creates the destination folder if it does not exist. When enabled, the missing destination folder is created.
Chunk Size (MB) Specifies the size of each chunk (in MB) for large file upload sessions. The value must be a multiple of 320 KB. The default is 8 MB.
Small Upload Limit (MB) Specifies the size threshold for choosing the upload method. Files smaller than or equal to this limit use a direct single-request upload, while files larger than the limit use chunked upload. The default is 4 MB.
Allow Destructive Actions Controls whether operations that delete data are permitted. Enable this parameter to allow operations such as Move and Delete. When disabled, these destructive operations are not allowed.
Timeout (Seconds) Specifies the maximum time to wait for an operation to complete before it times out. The default is 30 seconds.
Retry Count Specifies the number of automatic retry attempts when an operation fails. The default is 1.
Delay Between Retries (Seconds) Specifies how long to wait between retry attempts. The default is 1 second.
Delay Before Execution (Seconds) Specifies how long to wait before the component starts processing. The default is 0 seconds.
Delay After Execution (Seconds) Specifies how long to wait after the component finishes processing. The default is 0 seconds.
Continue on Error Determines how the workflow behaves when an unrecoverable error occurs.
  • Stop Workflow – Halts workflow execution.
  • Continue – Skips the current step and continues without passing the error downstream.
  • Continue Using Error Output – Continues execution and routes error details through the error output handle.

Outputs

Output Description
Result Returns a JSON object containing the operation result. Depending on the selected operation, the response may include the operation status, Drive ID, item details, or error information. Inspect the returned JSON to identify the fields available for the executed operation.

Configuration Notes

1. File Upload

The component supports direct and chunked uploads. The upload method is selected based on the configured Small Upload Limit (MB).

a. Files within the limit use a single-request upload.
b. Files exceeding the limit use a chunked upload session.
c. The Chunk Size (MB) value must be a multiple of 320 KB.

2. Folder Downloads

Folder downloads are subject to the following limits:

a. Maximum Total Size: 10 MB.
b. Maximum File Count: Controlled by the Max Folder Download File Count parameter. Set it to 0 to remove the file-count restriction.

3. Handling Existing Items

The Rename on Conflict setting determines how the component handles an item with the same name at the destination.

Enabled: Renames the incoming item to avoid a name conflict.
Disabled: Allows the existing item to be overwritten.

For Move and Copy operations, New Name specifies the name of the destination item.

4. Location Resolution

The Input Location and Destination Location parameters accept a supported SharePoint path or full SharePoint URL to identify the source or destination item.

Supported path formats may include:

a. Full SharePoint URL: The complete URL of a file or folder.
b. Site-relative path: For example, /sites/Finance/Shared Documents/report.pdf.
c. Short or relative path: For example, /Shared Documents/, where supported.

The Default Drive ID identifies the SharePoint document library when required. The component can resolve the drive automatically for supported full URLs and site-relative paths. If the component cannot resolve a short or relative path, provide the Drive ID associated with the intended document library.

Examples

Example 1: Upload a File

1. Select UploadFile as the operation.
2. Configure the Authentication Token.
3. Specify the file to upload using File Paths (Data/DataFrame), File Paths (Select Files), File Path, or Content (Base64), as applicable.
4. Enter the destination folder in Destination Location.
5. Configure Rename on Conflict and other applicable upload parameters.
6. Execute the component and verify the result.

Example 2: Download a File

1. Select Download as the operation.
2. Configure the Authentication Token.
3. Enter the SharePoint file path or full URL in Input Location.
4. Configure Default Drive ID if required to resolve the location.
5. Execute the component and verify the returned result.

How to Retrieve the SharePoint Drive ID

Follow these steps to retrieve the Drive ID of a SharePoint document library.

Steps

1. Open the required SharePoint site in a web browser and sign in if prompted. https://<your-tenant>.sharepoint.com/sites/<your-site-name>

2. Enter the following URL in the browser’s address bar, replacing the tenant and site name with the appropriate values: https://<your-tenant>.sharepoint.com/sites/<your-site-name>/_api/v2.0/drives

Press Enter to retrieve the JSON response containing the available document libraries.

3. Locate the required document library by checking its name property.

4. Identify the corresponding id property. This value represents the Drive ID of the document library.

5. Copy the Drive ID and use it in the relevant SharePoint operations.

Example

The JSON response may contain the following details:

{
“id”: “b!xYZ123abc…456DEF”,
“name”: “Documents”,
“driveType”: “documentLibrary”
}

In this example, b!xYZ123abc…456DEF is the Drive ID for the Documents library.

Note: A SharePoint site can contain multiple document libraries. Ensure that you copy the ID associated with the required library.

Tool Mode

Tool Mode enables the SharePoint Item Actions component to expose its supported SharePoint file and folder operations as tools for an Agent. Based on the task requirements, the Agent can select and invoke one or more available actions during execution.

Available Actions

Action Description
SHAREPOINT_CHECKEXISTS Checks whether a specified file or folder exists in SharePoint.
SHAREPOINT_UPLOADFILE Uploads a file using a supported file path, selected file, Data/DataFrame input, or Base64-encoded content to the specified SharePoint destination.
SHAREPOINT_DOWNLOAD Downloads a file or folder from SharePoint using its file path or web link for further processing.
SHAREPOINT_MOVE Moves a file or folder from one SharePoint location to another.
SHAREPOINT_COPY Copies a file or folder to another SharePoint location while preserving the original item.
SHAREPOINT_DELETE Deletes a specified file or folder from SharePoint.

How Tool Mode Helps

1. The Agent can select an appropriate action based on the task requirements.
2. It can check whether a file exists before downloading it.
3. It can upload a generated document to SharePoint.
4. It can move a processed file to an archive folder after processing.
5. It can combine multiple available actions when a task requires a sequence of operations.

Note: Enable Tool Mode to make the supported actions available to the Agent. Configure the required Authentication Token through Microsoft 365 App Integration in Robility Manager and ensure that the configured account has the necessary permissions for the selected actions. Refer to App Integration Token for token retrieval.

Troubleshooting

Issue What to Check
Authentication Failure Verify that the Authentication Token is valid and that Microsoft 365 is configured and accessible through App Integration in Robility Manager. Confirm that the account has the required permissions.
File or Folder Not Found Verify the Input Location path or URL and confirm that the file or folder exists and is accessible to the configured account.
Drive ID Resolution Failure Verify the path format and provide the correct Default Drive ID if the component cannot identify the document library automatically.
Upload Failure Verify the source file path, selected file, Data/DataFrame input, or Content (Base64), as applicable. Confirm the Destination Location, file permissions, and upload-related settings.
Download Failure Verify the source location and check the applicable download restrictions, including the 10 MB total size limit and file-count limit for folder downloads.
Destination Folder Not Found Confirm that the destination folder exists or enable Create Destination If Missing for supported operations.
Move or Delete Operation Not Allowed Verify that Allow Destructive Actions is configured appropriately and that the account has the required SharePoint permissions.
File Conflict at Destination Review Rename on Conflict to determine whether the incoming file should be renamed or the existing file overwritten.
Share this Doc

SharePoint Item Actions (Beta)

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online