Automating the creation of SharePoint Lists: Rules & Quick Steps

Intro to Rules & Quick Steps

If you’re new to Quick Steps or Rules, here’s a summary:

Rules - perform an action (send an email, set a field value) when a list item field changes.

Quick steps - similar to Rules, perform an action - but do it on the click of a button.

There are some differences in the available actions - Rules allow you only to send an email or set a field value, but Quick Steps also allow you to start a Flow, or start a Teams chat.

Rules and Quick Steps can often be used as a simple alternative where Microsoft Flow would otherwise be required. I believe Microsoft will continue to invest in this area since it’s quick and simple way to add automation - indeed, the new SharePoint Knowledge Agent integrates with them by automatically creating rules for you from a natural text request.

It turns out that Rules and Quick Steps share an API, and appear to be essentially the same thing on the backend - which makes sense, Quick Steps are simply rules where the trigger is a button press.

Retrieving Rules/Quick Steps

There’s a single API and they’re all returned at once;

POST $"/_api/web/lists(guid'{list.Id}')/GetAllRules()"

You’d think it would be a GET request - but a POST with an empty body is required. An array of rules is returned in JSON format with properties including Title and Condition.

Creating a new Rule

You can submit a request to the following endpoint: POST $"/_api/web/lists(guid'{list.Id}')/CreateRuleEx()"

You must include a body with the rule in a special “create” format which differs from the format of the GetAllRules response. I recommend that to get the correct format, you grab a network trace.

Authentication

A SharePoint bearer access token is required. It must use an end-user identity which can be acquired with SharePoint Framework, PowerAutomate, PowerShell or another method of automation. It will not work if you use an application-identity token. The rule will be created - but it won’t function correctly.

Summary

As you can see, List Rule and Quick Steps can be applied to lists automatically. For a managed provisioning service which includes this functionality (and any other SharePoint feature you would need), contact us and we’ll give you a demo.