Skip to content

Create Column Resource

Sanif Himani edited this page Jul 30, 2024 · 2 revisions

The create_column mutation will allow you to create a new column.

Basic Usage

This method accepts various arguments to create a column. You can find the complete list of arguments here.

You can pass these filters using the args option.

client = Monday::Client.new(token: <AUTH_TOKEN>)

args = {
  board_id: 123,
  title: "Work Status",
  description: "This is the work status column",
  column_type: :status
}
response = client.column.create(args: args)

puts response.success?
puts response.body

This will create a new column on the board with ID 123. The column will be of type status and will have "Work Status" as the title and "This is the work status column" as the description.

By default, this will return the columns' ID, title, and description fields.

The response body from the above:

{
  "data": {
    "create_column": {
      "id": "status",
      "title": "Work Status",
      "description": "This is the work status column"
    }
  },
  "account_id": 123
}

Customizing Field to Retrieve

You can customize the fields to retrieve by passing in the select option and listing all the fields you need to retrieve as an array.

client = Monday::Client.new(token: <AUTH_TOKEN>)

args = {
  board_id: 123,
  title: "Work Status",
  description: "This is the work status column",
  column_type: :status
}
select = %w[id archived width settings_str]

response =  client.column.create(args: args, select: select)

puts response.success?
puts response.body

You can find the list of all the available fields for columns API here.

Clone this wiki locally