ContentBlockByID
→ stringRenders a Content Builder asset by its numeric identifier.
Available in:
Email
CloudPage
Automation
Triggered Send
Syntax
Platform.Function.ContentBlockByID(id[, regionName, stopOnError, fallbackContent])
1–4 arguments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
number | Yes | The numeric ID of the Content Builder asset. |
regionName |
string | No | The impression region name to associate with this content block. |
stopOnError |
boolean | No | When true, stops rendering if the block is not found. Defaults to false. |
fallbackContent |
string | No | HTML string to render if the block is not found. |
Description
Renders a Content Builder block by its numeric asset ID. Prefer Platform.Function.ContentBlockByKey() as it uses the external key, which is more stable and human-readable than a numeric ID.
Example
var blockHtml = Platform.Function.ContentBlockByID(12345);
Write(blockHtml);