| 1 |
--- |
| 2 |
title: Store |
| 3 |
description: Returns a persistent data structure for storing and manipulating keyed values, scoped to the current shortcode. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
returnType: maps.Scratch |
| 9 |
signatures: [SHORTCODE.Store] |
| 10 |
--- |
| 11 |
|
| 12 |
{{< new-in 0.139.0 />}} |
| 13 |
|
| 14 |
Use the `Store` method to create a persistent data structure for storing and manipulating keyed values, scoped to the current shortcode. To create a data structure with a different [scope](g), refer to the [scope](#scope) section below. |
| 15 |
|
| 16 |
> [!NOTE] |
| 17 |
> With the introduction of the [`newScratch`][] function, and the ability to [assign values to template variables][] after initialization, the `Store` method within a shortcode is mostly obsolete. |
| 18 |
|
| 19 |
{{% include "_common/store-methods.md" %}} |
| 20 |
|
| 21 |
{{% include "_common/store-scope.md" %}} |
| 22 |
|
| 23 |
[`newScratch`]: /functions/collections/newScratch/ |
| 24 |
[assign values to template variables]: https://go.dev/doc/go1.11#texttemplatepkgtexttemplate |