---
schema_version: "1"
id: 39e31aee6fdee4fd376bd0ac2426c2f690d004114a2fa7b177e22cb693d330c6
title: Retrieve
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_templateRetrieve.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_templateRetrieve.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 361e95c19c01ac40be87d0234d06df00bfd4313f9289379b9f417ae8e02beb42
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Retrieve

## Overview

Retrieves a template based on the specified criteria

### Syntax

Retrieve(1)

### Function Properties

<!--complex table-->

| Ordinal | Type   |              | Description                                                                         |
| ------- | ------ | ------------ | ----------------------------------------------------------------------------------- |
| **1**   | string | **Required** | JSON object or filter expression containing criteria used to search for the account |

## Examples

This sample code retrieves a template based on the specified filter criteria:

```
var getTemplate = Template.Retrieve({Property:"CustomerKey",SimpleOperator:"equals",Value:"MyTemplate"});
```

This sample code queries across all applicable accounts and retrieves a template based on the filter criteria:

```
var query = {};

query.Filter = '{Property:"CustomerKey",SimpleOperator:"equals",Value:"MyTemplate"}';
query.QueryAllAccounts = true;

var getTemplate = Template.Retrieve(query);
```
