Skip to main content

channel_canvas_create

Facts​

DescriptionCreate channel canvas
SchemaSchema.slack.functions.ChannelCanvasCreate
Schema referenceslack#/functions/channel_canvas_create

Input Parameters​

Required Input Parameters

channel_idSchema.slack.types.channel_idRequired

Select a channel

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 channel canvas. The canvas_create_type will default to blank if not provided.

In order to use this Slack function in a coded workflow, you must do the following:

  1. The channel in which you want to create a canvas by using this function must be created by your coded workflow as a step before this function is called. You can use the create_channel Slack function to do this.

  2. The invoking user (i.e., the end-user triggering the workflow) must be a member of the newly-created channel before this function executes. There are two recommended ways of doing this:

    • The create_channel Slack function accepts a manager_ids parameter where you can assign a user as a channel manager. This allows you to automatically add a user to a channel when creating it.

    • You could call the invite_user_to_channel Slack function after the create_channel Slack function completes to invite the invoking user to the channel.

In addition, the app calling this function will need the following App Home features configured in its manifest file:

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

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

Example workflow step​

const createChannelCanvasStep = ExampleWorkflow.addStep(
Schema.slack.functions.ChannelCanvasCreate,
{
channel_id: "CHAN123456",
canvas_create_type: "template",
canvas_template_id: "TEM123456",
content: { inputs.content }
},
);