# Schedule Templates

Schedule Templates let you save a week's shift pattern and reuse it in the future. Instead of rebuilding the same schedule from scratch every week, save it as a template and apply it in seconds -- with options to replace or merge with existing shifts.

---

## Accessing Templates

There are two ways to work with templates:

1. **From the Schedule Calendar** -- Click the `Templates` dropdown in the secondary bar. This shows a quick list of saved templates with options to load or save.
2. **Templates Management Page** -- Navigate to `/admin/{storeCode}/schedule/templates` for the full management interface. You can also reach this by clicking `Manage Templates` in the Templates dropdown.

You need the `uri_schedule_manage` permission to create, edit, delete, or apply templates.

---

## Creating a Template

### From the Schedule Calendar

1. Build the week's schedule the way you want it on the calendar.
2. Click the `Templates` dropdown in the secondary bar.
3. Click `Save Current Week as Template`.
4. Enter a **Template Name** (required, 1-100 characters, must be unique).
5. Optionally add a **Description** (up to 500 characters) with notes about when to use this template.
6. Review the **Source Week** and **Shifts to Save** count shown in the info box.
7. Click `Save Template`.

### From the Templates Page

1. Go to the Templates management page.
2. Click `Create from Current Week`.
3. This redirects you to the Schedule Calendar with the save template dialog open.

> **Tip:** Give templates descriptive names like "Summer Weekend Schedule" or "Holiday Staffing" so they are easy to find later.

---

## Viewing Templates

On the Templates management page, each template appears as a card showing:

| Field | Description |
|-------|-------------|
| **Name** | The template name you assigned |
| **Description** | Your notes about the template |
| **Shift Count** | Number of shifts stored in the template |
| **Last Used** | When the template was last applied to a schedule |

Click the three-dot menu on any template card to access:

- **View Details** -- Opens a detailed modal showing template name, creation date, shift count, last used date, description, and a day-by-day shift breakdown.
- **Edit** -- Modify the name, description, or replace the template's shifts with a different week.
- **Delete** -- Permanently remove the template.

---

## Loading (Applying) a Template

### Quick Load from Calendar

1. Click the `Templates` dropdown on the Schedule Calendar.
2. Click a template name from the list.
3. The Load Template modal opens.

### Load from Templates Page

1. On the Templates management page, click `Load to Schedule` on any template card.
2. This navigates to the Schedule Calendar and opens the Load Template modal.

### Load Template Options

The Load Template modal provides several configuration options:

**Load Mode:**

| Mode | Description |
|------|-------------|
| **Replace** | Deletes all current week shifts first, then adds the template shifts. Use this for a fresh start. |
| **Merge** | Adds template shifts alongside existing ones. Use this to fill in gaps without removing what you already have. |

**Load as Open Shifts:**
- Check this option to strip employee assignments from the template shifts, creating unassigned open shifts instead.
- Useful when you want the shift pattern but need different employees to fill the slots.

### Conflict Detection

When loading a template, the system checks for conflicts:

- **Overlapping shifts** -- An employee already has a shift during the same time window.
- **Availability conflicts** -- The template assigns an employee during a time they marked as unavailable.

If conflicts are detected, a conflict table appears showing:
- The day and time of each conflict
- The affected employee
- The nature of the issue
- Options to include or skip each conflicting shift

Use `Select All` / `Deselect All` to quickly manage conflict selections.

### Applying

1. Choose your load mode (Replace or Merge).
2. Optionally check `Load as Open Shifts`.
3. Review and resolve any conflicts.
4. Click `Apply Template`.

The template's shifts are created on the current calendar week.

---

## Editing a Template

1. On the Templates management page, click the three-dot menu on a template card.
2. Select `Edit`.
3. Modify the **Template Name** or **Description**.
4. Optionally check `Replace template shifts with current week's schedule` to update the stored shift data.
   - If checked, select the **Source Week** (the Monday of the week to copy shifts from).
5. Click `Save Changes`.

> **Warning:** Replacing template shifts is destructive -- the old shift data in the template is permanently overwritten.

---

## Deleting a Template

1. On the Templates management page, click the three-dot menu on a template card.
2. Select `Delete`.
3. Confirm the deletion in the modal.

This action cannot be undone.

---

## Best Practices

- **Create templates for recurring patterns** -- If you have a standard weekday schedule and a different weekend schedule, save each as a template.
- **Use descriptive names** -- "Mon-Fri Standard (8 employees)" is more helpful than "Template 1."
- **Update templates when patterns change** -- Use the edit function to replace shifts with an updated week's schedule.
- **Use Merge mode for partial templates** -- Save a "Weekend Coverage" template and merge it with your existing weekday schedule.
- **Load as Open Shifts first** -- When staffing changes between weeks, load as open shifts and then manually assign the right people.

---

## Troubleshooting

### Template shows 0 shifts
- The template was saved from a week that had no shifts, or the shifts were deleted after saving.
- Edit the template and replace shifts from a week that has the desired schedule.

### Conflicts preventing load
- Review each conflict in the conflict table. You can deselect individual conflicting shifts to skip them.
- Switch to Merge mode if you want to add shifts without replacing existing ones.

### Template not appearing in the dropdown
- Refresh the page. Templates are loaded dynamically.
- Confirm the template was saved successfully (check for error messages).

---

## Related Articles

- [Schedule Calendar](/support/articles/schedule-calendar) -- Creating and managing shifts on the calendar
- [AI-Powered Scheduling](/support/articles/ai-powered-scheduling) -- Automated schedule generation
