> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rootly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SharePoint

> Connect Microsoft SharePoint to Rootly to automatically create and update Word documents in SharePoint sites during incidents for retrospectives and reports.

## Introduction

The SharePoint integration connects Rootly with your Microsoft SharePoint environment so teams can automatically create and update Word documents in SharePoint sites through Genius workflows. Documents are created as `.docx` files in the SharePoint site and drive of your choice.

With the SharePoint integration, you can:

* Automatically create Word documents in SharePoint from incident workflows
* Populate documents using Rootly retrospective templates or custom Liquid content
* Update existing SharePoint documents as an incident progresses
* Navigate your SharePoint hierarchy — Sites, Drives, and Folders — to place documents precisely where you need them
* Attach created documents directly to the incident record

## Before You Begin

Before setting up the integration, make sure you have:

* A Rootly account with admin permission to manage integrations
* A Microsoft 365 account with access to SharePoint
* Permission to authorize applications in your Microsoft tenant

<Callout icon="user-shield" color="#DBEAFE">
  We recommend installing with a dedicated service account so the integration does not break if an individual user leaves your organization.
</Callout>

## Installation

<Steps>
  <Step title="Open the SharePoint integration in Rootly" icon="plug">
    Navigate to the integrations page in Rootly and select **SharePoint**.
  </Step>

  <Step title="Authorize Rootly with Microsoft" icon="key">
    You will be redirected to Microsoft to sign in and grant Rootly the permissions required to access your SharePoint environment.

    Rootly requests the following Microsoft Graph permissions:

    | Permission            | Purpose                                                   |
    | --------------------- | --------------------------------------------------------- |
    | `offline_access`      | Maintain access without requiring re-authentication       |
    | `User.Read`           | Read your profile and basic organizational information    |
    | `Sites.Read.All`      | Read documents and list items across all site collections |
    | `Files.ReadWrite.All` | Read, create, update, and delete files you have access to |

    <Callout icon="info" color="#DBEAFE">
      Rootly uses `Files.ReadWrite.All` to create and update incident documents. `Sites.Read.All` is used to discover available sites and drives when configuring workflow actions.
    </Callout>

    Once authorized, the installation is complete.

    <Callout icon="circle-check" color="#DCFCE7">
      After authorization, the **Create a SharePoint Page** and **Update a SharePoint Page** workflow actions are available in your Genius workflows.
    </Callout>
  </Step>
</Steps>

## Workflow Actions

### Create a SharePoint Document

This action creates a new Word document (`.docx`) in a specified SharePoint location.

**Name**
The display name for this workflow action. Rename it to describe what the action does.

**Site**
The SharePoint site where the document will be created. Rootly discovers available sites from your Microsoft tenant.

**Drive**
The document library (drive) within the selected site. Each SharePoint site can have multiple drives.

<Callout icon="info" color="#DBEAFE">
  SharePoint organizes content as **Sites > Drives > Folders**. Select the Site first, then the Drive, and optionally a Folder within that Drive.
</Callout>

**Parent Folder**
The folder within the selected Drive where the document will be created. Leave blank to place the document in the root of the Drive.

**Title**
The title and filename of the Word document. Defaults to `{{ incident.title }}`. Supports Liquid syntax.

<Callout icon="lightbulb" color="#DBEAFE">
  Use the [Incident Variable Explorer](https://rootly.com/account/help/liquid-explorer) to preview what Liquid variables return for your incidents.
</Callout>

**Retrospective Template**
Select a predefined Rootly retrospective template to populate the document body. Templates are managed on the [Retrospective Templates page](https://rootly.com/account/retrospective-steps?tab=documents).

<Callout icon="triangle-exclamation" color="#FEF3C7">
  If a Retrospective Template is selected, it overrides any content defined in the Custom Content field.
</Callout>

**Custom Content**
Define the document body manually using HTML content. Supports Liquid syntax. Used when no Retrospective Template is selected.

**Mark Post Mortem as Published**
When enabled, marks the retrospective status as `published` after the document is created. Use this when follow-up notification workflows trigger on published retrospectives.

### Update a SharePoint Document

This action updates an existing SharePoint Word document with new content.

**File ID**
The SharePoint item ID of the document to update. Supports Liquid syntax.

<Callout icon="info" color="#DBEAFE">
  When a **Create a SharePoint Page** action runs, Rootly stores the resulting document ID and URL on the incident record. Reference the file ID in subsequent update actions using Liquid variables.
</Callout>

**Title**
The updated title for the document. Supports Liquid syntax. Leave blank to keep the existing title.

**Content**
Additional HTML content to append to the document. Supports Liquid syntax.

**Retrospective Template**
Re-render the document body using a Rootly retrospective template.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The SharePoint integration is not showing available sites or drives" icon="circle-exclamation">
    Confirm the integration was authorized with an account that has access to the SharePoint sites you want to use. If your tenant has many sites, try searching by name in the site selector. Re-authenticating the integration may also refresh the available site list.
  </Accordion>

  <Accordion title="Document creation is failing with a permissions error" icon="lock">
    Verify that the authorized Microsoft account has write access to the target SharePoint drive and folder. The `Files.ReadWrite.All` permission grants access to files the authorizing user can access — it does not bypass SharePoint site permissions.
  </Accordion>

  <Accordion title="The created document is not appearing in SharePoint" icon="file-circle-question">
    Check the workflow run log in Rootly for any errors returned from the SharePoint API. Confirm the selected Site, Drive, and Folder exist and are accessible to the authorized account.
  </Accordion>
</AccordionGroup>

## Uninstall

To remove the SharePoint integration, open the integrations panel in Rootly and select **Configure > Delete**.
