---
title: "snapshot-page macro"
canonical: "https://support.appfire.com/space/CDML/649694908/snapshot-page%20macro"
format: markdown
---
> Macro (aura-html)


## Overview

> Macro (excerpt)
> 
> Create a static versioned snapshot of a document

The **snapshot-page** macro is used to publish a static version of a document. The macro

- creates a snapshot of the page
- links the snapshot to one or more collections

> ℹ️ [Comala Publishing](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=AHP&title=Welcome%20to%20Comala%20Publishing) must be installed to use the **snapshot-page** macro

## Where to use it?

Optional

One or more **snapshot-page** macros can be put in a [trigger macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133).

> 📝 The **snapshot-page** macro is available in Comala Document Management [v6.17.6](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649594365)+ together with Comala Publishing v3.0+

## Parameters

| Parameter | Required | Default | Notes | Ver |
| --- | --- | --- | --- | --- |
| `collection` | :check_mark: | *none* | Name of the **snapshot collection **where the snapshot document is published<br>- snapshot collection must be linked to the current space in the space tools snapshot publishing dashboard
- supports the use of value references including workflow parameters<br>> 📝 If the collection doesn't exist the macro will create the named collection(s). | [v6.17.6](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649594365) |
| `editor` |  |  | Name of the snapshot **contributor** for the named **collection**.<br>The contributor is the user who will be set as the the creator of the snapshot document version.<br>- if the parameter is not used, the current user is set as the contributor for the snapshot document version created<br>- supports the use of value references including workflow parameters<br>`{snapshot-page:collection=@Worfklow Parameter@|editor=@user@}` |  |
| > ℹ️ When using **Confluence v7.19 or earlier**, you must configure [global snapshot publishing](https://appfire.atlassian.net/wiki/spaces/AHP/pages/649693784) in Comala Publishing to set a user and a token to enable integration with Comala Document Management and the functionality of the snapshot-page macro. |  |

A snapshot created with a trigger specifying a collection that does not exist (or a collection for which the user does not have contributor permission) will be added to the space default [Unassigned collection](https://appfire.atlassian.net/wiki/spaces/AHP/pages/649530667).

![image](media://7b351f90-3346-4c29-9421-ce55a4980856)

A warning message is also displayed on the page. For example, if the **mine** collection does not exist.

![image](media://5ebae614-56a4-4d43-9657-cc8b1dca9ee5)

## Snapshot event reference

The URL for the location of the created snapshot document is added as a value to the event reference `@snapshoturl@` and can be used as a value reference. For example, in a `set-message` action macro body content.

```
{trigger:statechanged|state=Done}
        {snapshot-page:collection=Uncontrolled Internal Repository|editor=@user@}
        {set-message:duration=1m}
        Document finished @datetime@. Static snapshot added to the Uncontrolled Internal Repository.
        This can be viewed [here|@snapshoturl@] or by choosing the View option in the popup accessed using the snapshot byline on the page.
        {set-message}
    {trigger}
```

![image](media://33664273-2da3-4169-b6df-c9213cc3526f)

The value for `@snapshoturl@` is a URL for the snapshot document in the named collection viewed through the [collections global viewer](https://appfire.atlassian.net/wiki/spaces/AHP/pages/650119475). For example

```
https://myconfluence.com/snapshots/collections/viewer/global.action#!4e48c108-68d7-4727-b72a-fc5cc972cdc3/151948182
```

## Example

```
{trigger:statechanged|state=Published}
    {snapshot-page:collection=Published Documents Record|editor=@snapshotpublishinguser@}
{trigger}  
```

Publishes snapshot of the Confluence document version on a transition to the workflow **Published** state. The snapshot is added to the **Published Documents Record** collection.

The editor (contributor of the snapshot document version to the collection) is the value of the user workflow parameter  `@snapshotpublishinguser@`.

> 📝 The user must have contributor permission for the named collections.

## Related pages

- [Snapshot Publishing](https://appfire.atlassian.net/wiki/spaces/AHP/pages/650215885)
- [Welcome to Comala Publishing](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=AHP&title=Welcome%20to%20Comala%20Publishing)