---
schema_version: "1"
id: b8850a07daa270ee39220bcb5de4154079649473be2a520ae43ce29ba74eec92
title: ContentBlockByName
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_platformContentContentBlockByName.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformContentContentBlockByName.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7b249a432ae495db08991eedec9c018953cbf342723292f35610fa88647bc813
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# ContentBlockByName

## Overview

Retrieve content from a specified content block in Content Builder. This function will only work with shared content in a business unit if it is shared using a shared folder.

### Syntax

ContentBlockByName(1, 2, 3, 4, 5)

### Function Properties

<!--complex table-->

| Ordinal | Type    |              | Description                                                                                                                                                                                                                                                |
| ------- | ------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **1**   | string  | **Required** | Name of the content block to return, including the path within the my contents folder if necessary                                                                                                                                                         |
| **2**   | string  |              | Impression region for content                                                                                                                                                                                                                              |
| **3**   | Boolean |              | Indicates whether the function returns an error when the system can’t locate the specified content area or returns an invalid content area. A value of true returns an error. A value of false does not return an error.                                   |
| **4**   | string  |              | Default content to return if an error occurs and no error returns. This value defaults to an empty string.                                                                                                                                                 |
| **5**   | string  |              | Returns the status of the call. A value of 0 indicates the function found the content area and successfully rendered the content. A value of -1 indicates either no content or an invalid content area, so the function returns the default content value. |

## Example

```
<script runat="server">
var content = Platform.Function.ContentBlockByName("Content Builder\\Content One");
Platform.Response.Write(content);
</script>
```
