Skip to content

SharePoint - Create Folder Structure

What it does

Find or create a root folder, then ensure a deduplicated set of direct child folders exists underneath it.

This action is designed for repeatable structures. It finds or creates the root and deduplicates direct child names. It does not create arbitrarily deep nested paths from the Subfolders field.

When to use it

  • Create a repeatable client or project folder structure in one action.
  • Prepare standard direct child folders such as Contracts, Invoices, and Reports.

Create a repeatable client or project folder structure in one action.

Requirements

  • A connected Microsoft 365 connection for this HighLevel Location.
  • The Drive ID of the approved SharePoint document library.
  • A root folder name; optional subfolders are entered one per line and are direct children only.

Inputs

Action inputs
InputTypeRequiredDescriptionExample value
Document Library (Drive ID)stringYesMicrosoft Graph Drive ID for the SharePoint document library. The Drive ID identifies the library itself and can be reused across workflow actions.b!exampleDriveId123
Parent Folder PathstringNoFolder path inside the selected document library, for example Customers/Acme Ltd. Do not include the document library name. Leave empty to use the document library root.Customers/Example Client
Root Folder NamestringYesDirect child folder name to find or create.Example Client
SubfolderstextareaNoOptional direct child folder names, one per line. Each entry creates a folder directly under the new root folder. Do not use / or \ in these entries.Contracts\nInvoices\nReports

Example values

Document Library (Drive ID)
b!exampleDriveId123
Parent Folder Path
Customers/Example Client
Root Folder Name
Example Client
Subfolders
Contracts\nInvoices\nReports

Example workflow

Example action workflow
  1. HighLevel workflow trigger

    The business event that starts the workflow.

  2. SharePoint - Create Folder Structure

    Run the SharePoint operation with the approved Drive ID and action-specific inputs.

  3. Use the confirmed result

    Map only the documented outputs required by the next workflow step.

A common pattern is: client onboarding trigger → Create Folder Structure → use Root Folder ID and the returned Folders collection in later steps.

Outputs

Action outputs
OutputTypeDescriptionExample valueUse in later steps
SuccessbooleanConfirms that the action completed successfully.trueUse as a completion checkpoint before relying on other outputs.
Root Folder IDstringDriveItem ID of the root folder.example-root-folder-idMap into later operations that target the root folder.
Root Folder NamestringName of the root folder.Client FilesUse in workflow messages or audit text.
Root Web URLstringSharePoint web link for the root folder.https://example.invalid/Client%20FilesUse when staff need a direct link to the root folder.
Created RootbooleanWhether this run created the root folder.trueUse for reporting or repeated-run logic.
Folder CountnumericalNumber of direct child folders returned by the action.2Use to confirm how many child folder results were returned.
FoldersarrayArray of direct child folder results, including IDs, names, links, and created flags.[{"id":"example-child-folder-id-1","name":"Contracts","web_url":"https://example.invalid/Client%20Files/Contracts","created":true},{"id":"example-child-folder-id-2","name":"Invoices","web_url":"https://example.invalid/Client%20Files/Invoices","created":false}]Use the returned child IDs, names, links, and created flags in later logic.

How to use outputs in later HighLevel steps

  • Success: Use as a completion checkpoint before relying on other outputs.
  • Root Folder ID: Map into later operations that target the root folder.
  • Root Folder Name: Use in workflow messages or audit text.
  • Root Web URL: Use when staff need a direct link to the root folder.
  • Created Root: Use for reporting or repeated-run logic.
  • Folder Count: Use to confirm how many child folder results were returned.
  • Folders: Use the returned child IDs, names, links, and created flags in later logic.

Use Created Root to see whether the root was newly created. The Folders array reports each direct child and whether that child was created during this run.

Permissions required

  • Microsoft Graph application permission Sites.Selected on the customer-owned Entra app.
  • The SharePoint site containing the document library must grant the app at least write access for this operation.
  • The action does not require tenant-wide SharePoint access merely for discovery or name matching.

Common errors

Authentication unavailable / 401
This HighLevel Location does not have a usable Microsoft connection. Verify the Location connection before changing SharePoint permissions.
403
The Entra app lacks access to the selected SharePoint site or the granted role is too narrow for the operation. Verify Sites.Selected consent and the site's write grant.
404
The Drive ID, folder path, or Item ID does not resolve in the connected tenant and approved site. Recheck the administrator's Drive ID map and the exact path or Item ID.
429
Microsoft Graph throttled the request. Retry later and avoid high-volume loops without bounds.

Product/action version

Product version
Pre-launch technical release · 2026-10-04
Action version
1.2
Implementation reference
Integration commit 8440a0f · src/modules/workflows/actions/sharepoint-create-folder-structure.json · code/sharepoint_create_folder_structure.1.2.js

Last updated