SharePoint / SharePoint/sp-dev-docs

List templates created from a list do not include Automate rules, and there is no way from CSOM to retrieve or create one

Open
#9,875 3 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Jun 3, 2025.

Needs: Triage :mag: sharepoint-developer-support type:bug-suspected type:uservoice-request
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint CSOM

Developer environment

Windows

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details
  • CSOM v 16.1.25110.12000
Describe the bug / error

When creating a site template the information regarding Automate rules is not saved in the template, and recreating a list from a template will not copy it over. PnP uses the site script to retrieve and create any rule on a list, but has no way to save the content in a site script. There should be a way to save the rules with a switch (as done for the data) in the List.SaveAsTemplate() call or alternately a way to access, retrieve, create and execute site scripts to allow users to access "modern" features also via CSOM (as the underlying API is a REST API.

Steps to reproduce
  1. Save a template via List.SaveAsTemplate()
  2. Create a list specifying the previously created template in the ListCreationInformation object
  3. Open the old and new list in top bar -> Automate -> Rules -> Manage Rules, they do not match.
Expected behavior

The rules (as well as any modern features) can be selected to be saved in the template and subsequently recreated on template usage. Alternately, expose the site script retrieval and execute REST APIs in CSOM as they are already exposed and useable in PnP to circumvent the issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.