Skip to main content

canvas_create

Facts​

DescriptionCreate a canvas
SchemaSchema.slack.functions.CanvasCreate
Schema referenceslack#/functions/canvas_create

Input Parameters​

Required Input Parameters

owner_idSchema.slack.types.user_idRequired

Canvas owner

titleSchema.types.stringRequired

Canvas name

Optional Input Parameters

canvas_create_typeSchema.types.stringOptional

Type of creation. Options are blank or template. Default is blank. If type is blank or undefined, no canvas_template_id is needed. If type is template, provide a canvas_template_id.

canvas_template_idSchema.slack.types.canvas_template_idOptional

Select a canvas template. Only needed if canvas_create_type is set to template.

contentSchema.slack.types.expanded_rich_textOptional

Add content. Content should only be provided if canvas_create_type is set to blank.

placeholder_valuesSchema.types.objectOptional

A dictionary of key-value pairs representing canvas variables provided only when canvas_create_type is set to template.

Output Parameters​

Required Output Parameters

canvas_idSchema.slack.types.canvas_idRequired

Canvas link

Usage info​

This function creates a canvas. If canvas_create_type is not passed, it is set as blank.

The app using this function will need the following App Home features set in the app manifest file:

features: {
appHome: {
messagesTabEnabled: true,
messagesTabReadOnlyEnabled: false,
},
},

For information about the expanded_rich_text type that you can use to create your canvases, refer to expanded_rich_text.

Example workflow step​

const createCanvasStep = ExampleWorkflow.addStep(
Schema.slack.functions.CanvasCreate,
{
title: "My new canvas",
owner_id: "PERSON12345",
canvas_create_type: "blank",
content: { inputs.content }
},
);