> Portal Navigation:
>
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt
## Resource: Sample Flows
## Article: Sample Flows
## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/sample-flows.md
## Article Content:
# Data Collections API: Sample Use Cases & Flows
This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful starting point as you plan your implementation.
## Set up a tutorials collection with references to collections for categories and authors
You can use the Data Collections API to set up a site's tutorials section by first creating collections for categories and authors to organize content, and then creating a tutorials collection that references those collections.
To set up the collections:
1. Call [Create Data Collection](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/create-data-collection.md) to create a `categories` collection. Include the following properties in your request:
In the `fields` array, include fields with these recommended values for `type`:
- `title`, `slug`, `description`, and `videoUrl`: `TEXT`
- `icon`: `IMAGE`
- `sortOrder`: `NUMBER`
1. Call [Create Data Collection](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/create-data-collection.md) to create an `authors` collection. Include the following properties in your request:
In the `fields` array, include fields with these recommended values for `type`:
- `name`, `slug`, `bio`, and `email`: `TEXT`
- `photo`: `IMAGE`
- `socialLinks`: `OBJECT`
1. Call [Create Data Collection](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/create-data-collection.md) to create a `tutorials` collection. Include the following properties in your request:
In the `fields` array, include fields with these recommended values for `type`:
- `title`, `slug`, and `description`: `TEXT`
- `content`: `RICH_TEXT`
- `publishDate`: `DATETIME`
- `featured`: `BOOLEAN`
- `estimatedTime`: `NUMBER` for the reading time in minutes.
Also include the following `fields` to add cross references to your `categories` and `authors` collections created earlier.
- `category`: with `type` set to `MULTI_REFERENCE` and `typeMetadata.multiReference.referencedCollectionId` set to `categories`.
- `author`: with `type` set to `MULTI_REFERENCE` and `typeMetadata.multiReference.referencedCollectionId` set to `authors`.
Set `permissions` to control the collection's access as follows:
- `read`: `ANYONE` so visitors can view tutorials
- `insert`, `update`, and `remove`: `ADMIN` so only site owners can manage content.
1. Call [Get Data Collection](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/get-data-collection.md) with `dataCollectionId` set to `tutorials` to retrieve the full collection schema and confirm all fields are configured correctly.
## Add draft/publish functionality to a collection
You can enable draft and publish functionality for a site's content by adding a publish plugin to a collection. This allows content creators to save work in progress without making it visible to site visitors.
To add publish functionality:
1. Call [Add Data Collection Plugin](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/add-data-collection-plugin.md) and set `plugin.type` to `PUBLISH` and `plugin.publishOptions.defaultStatus` to `DRAFT` so new content is created as a draft by default.
3. The collection now supports draft and published states. Use the [Data Items API](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/introduction.md) to manage item publication status.