capabilities.work

Provision a List and Seed Its First Item

A 4-step recipe with Microsoft SharePoint. We can help you get access.

Recipe · 4 steps

Provision a List and Seed Its First Item

Idempotently create a SharePoint list, confirm it, and add its first item.

  1. Ask whether a list with this title already exists. This is what makes the workflow safe to re-run; a match short-circuits the create step.
  2. Create the list. The __metadata type must be SP.List for the SharePoint REST service to accept the entity.
  3. Read the list back by title so both branches converge on the same authoritative id, item count, and versioning posture.
  4. Write the first item so downstream readers have real content. The __metadata type is list specific and must match the list's item entity type.
What you'll need to have ready
  • listTitle: Title of the list to provision (e.g. "Project Tasks").
  • listDescription: Human readable description stored on the list.
  • baseTemplate: SharePoint list template id. 100 = Generic List, 101 = Document Library, 104 = Announcements.
  • listItemEntityType: The OData entity type name for items in this list, e.g. "SP.Data.ProjectTasksListItem". Required in the __metadata block of any item write.
  • seedItemTitle: Title of the first item written into the new list.
For your developer

Arazzo workflow sharepoint:provision-list, 4 operations: getLists → createList → getListByTitle → createListItem. Specs on APIs.io.