replaceBlock
Replaces the selected component on the canvas of a marketing content item. Updates persist when the user saves their changes in the content builder. Use this function when building a CMS extension for Marketing Cloud Next that interacts with components on the canvas.
| Parameter Name | Type | Description | Required? |
|---|---|---|---|
selectedBlock | Object | The new component that replaces the selected component on the canvas. | ![]() |
nodeId | String | The ID of the selected component (or node) to be replaced. This field must be included in an object as the second parameter. | ![]() |
- A Promise object that resolves when the
replaceBlockaction has been initiated. The replacement operation is asynchronous in the content builder. error—A validation error indicating that thenodeIdwas invalid or not provided, or that the block is invalid.
