> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/sandbox-management/templates/creating-a-template.md).

# Creating a Template

## ![](https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2F6B2NEvLIqTPIjxRAb5oF%2FSummary2-Small-Icon.svg?alt=media\&token=b06e08da-3f2a-4100-88aa-8fcc17033b56) Overview

This article explains how to create a template in Sandbox Management. A template is a sequence of steps that runs after a sandbox is created or refreshed, so every sandbox you create with it is set up the same way.

A template has four stages, which always appear in the same order: **Backup**, **Post-config Steps**, **Data Migration**, and **Flosum Topology**. Each stage contains one or more steps that you turn on with a toggle. This article creates a template that populates a sandbox with data and adds the sandbox to your Flosum topology, using the **Data Migration** and **Connect to Flosum Topology** steps.

To use your template when you create a sandbox, see the following article.

* [Creating a Sandbox with a Template](/sandbox-management/sandboxes/creating-a-sandbox-with-a-template.md)

{% hint style="info" %}

#### Before You Begin

The **Data Migration** step uses a Data Migrator template to choose which records to copy into the sandbox. You can use one of Data Migrator's system templates or create your own before you start.

* [Creating a Template](/data-migrator/templates/template-designer/creating-a-template.md)
  {% endhint %}

## Creating a New Template

{% stepper %}
{% step %}

### Open the Create Template Form

1. Click **Templates** from the left sidebar menu.
2. Click **Create Template**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fnwa4Ixk9Oi6v6fAqMUtu%2FCreatingATemplate-01.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
3. Enter a **Name** for the template.
4. Click **Create**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fnqs24IYgmEUJuOocXgK4%2FCreatingATemplate-02.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Configure the Backup Step

The **Metadata** step backs up the sandbox's current metadata before a refresh. This example doesn't use it, so the instructions below skip this step.

1. Click **Next**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Ftv1ZoJYTo77njWqkXnKJ%2FCreatingATemplate-03.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Moving Between Stages

You can't move to the next stage while a step that is turned on has empty required fields. Complete the step's required fields or turn the step off. A green check on a stage means you have visited it, not that it has steps turned on. The **Summary** panel shows which steps are **Enabled**.
{% endhint %}
{% endstep %}

{% step %}

### Configure the Post-config Steps

The **Post-config Steps** stage holds steps that configure the sandbox, such as restoring Connected Apps, scheduled Apex jobs, and named credentials. This example doesn't use them, so the instructions below skip this stage.&#x20;

1. Click **Next**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FB8vTvA5Y2rclDUkYsHRH%2FCreatingATemplate-04.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Configure the Data Migration Step

The **Data Migration** step copies records into the sandbox with a Data Migrator template.

1. Click the **Data Migration** toggle to turn on the step.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2F1yNxlR4GyINLTB0Nken9%2FCreatingATemplate-05.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click the **Template** dropdown menu.
3. Select the Data Migrator template that copies the records you want.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FPVVtt5PF631aVHvYy5SI%2FCreatingATemplate-06.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
4. (Optional) Enter a **Root record limit** to limit the number of root object records copied into the sandbox.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FNfiUTmJhdLc6ow6rPK48%2FCreatingATemplate-07.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
5. Click **Next**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FNJ19SYi2MB6kHcaUaL0e%2FCreatingATemplate-08.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Configure the Flosum Topology Step

The **Connect to Flosum Topology** step sets the environment of the sandbox's organization in Global Settings and assigns it apps.

1. Click the **Connect to Flosum Topology** toggle to turn on the step.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fp59rzbi8Z8uZLigNrL2D%2FCreatingATemplate-09.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click the **Environment** dropdown menu.
3. Select **Dev**, **QA**, **Test**, or **Prod**.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FCf7hWV6YMEx5Nt3OPZKJ%2FCreatingATemplate-10.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
4. Click the **Assign applications** dropdown menu.
5. Check each app to assign to the sandbox's organization.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fq57Rh5siRn6juVx7THIO%2FCreatingATemplate-11.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="warning" %}

#### Assign Only Apps a Sandbox Can Use

Check only apps that your tenant's Global Settings can assign to a sandbox. If the template assigns an app that the sandbox can't be assigned, the **Flosum topology** step fails and the sandbox is left **Incomplete**. For example, Audit & Compliance can't be assigned to a sandbox, so don't check **Audit Compliance**.
{% endhint %}
{% endstep %}

{% step %}

### Save the Template

1. Click **Save Changes**.
2. Click **Close** to return to the **Templates** page.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2FMYUClfJ4AQK5SJ0WooyD%2FCreatingATemplate-12.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>
3. The template appears in the **Templates** list with the steps it runs.

   <div align="left"><figure><img src="https://2897630434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0DT0D4zemyodlhvoU1XB%2Fuploads%2Fdg4ibfTq0h7lNzq3gX5a%2FCreatingATemplate-13.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}

#### Templates and Topologies

A template is available only in the topology where you create it. You can use it with any source organization in that topology.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/sandbox-management/templates/creating-a-template.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
