---
schema_version: "1"
id: 075d6e0acf49f26865dd58fefa44295f3dba0e712bab08b8af131c8b02dd793f
title: ContentBlockByKey
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_platformContentContentBlockByKey.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformContentContentBlockByKey.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7628ceee86d4f389c0b0f093ee8774422a4a1aaa6088053fef5045eaa21d2fa8
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# ContentBlockByKey

## Overview

Retrieve content from a specified content block in Content Builder

### Syntax

ContentBlockByKey(1, 2, 3, 4)

### Function Properties

<!--complex table-->

| Ordinal | Type    |              | Description                                                                                                                                                                   |
| ------- | ------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **1**   | string  | **Required** | External key for content block                                                                                                                                                |
| **2**   | string  |              | Impression region for content                                                                                                                                                 |
| **3**   | Boolean |              | Indicates whether a call proceeds if it fails to retrieve content. A value of true returns an exception and terminates the call. A value of false allows the call to proceed. |
| **4**   | string  |              | Default content to display if the call does not return content from the specified content area                                                                                |

## Example

```
<script runat="server">
     var content = Platform.Function.ContentBlockByKey("myExternalKey","impressionRegion",false,"defaultContentHere");
</script>
```
