Dropdown

Learn how to filter, read, update, and clear the dropdown column on monday boards using the platform API

The dropdown column lets a user select one or more options from a list. You can use the API to read, create, filter by, update, and clear the dropdown column.

Read the dropdown column

You can query the dropdown column using the column_values object that enables you to return column-specific subfields by sending a fragment in your query. Values for the dropdown column are of the DropdownValue type.

query {
  items (ids:[1234567890, 9876543210]) {
    column_values {
      ... on DropdownValue {
        values { 
          label 
          id
				}
        column {
          id
        }
      }
    }
  }
}
const query = `query($itemIds: [ID!], $columnType:[ColumnType!]) { items (ids:$itemIds) { id column_values (types:$columnType) { column { title id } ... on DropdownValue { values { label id } } } } }`;
const variables = {
  itemIds: [9571351485, 9572374902],
  columnType: "dropdown"
};

const response = await mondayApiClient.request(query, variables);

Fields

FieldDescription
column Column!The column the value belongs to.
id ID!The column's unique identifier.
text StringThe column's value as text. This field will return null if the column has an empty value.
type ColumnType!The column's type.
value JSONThe column's JSON-formatted raw value.
values [DropdownValueOption!]!The selected dropdown values.

Create a dropdown column

Required scope: boards:write

The create_column mutation creates a dropdown column with custom labels via the API. You can also specify what fields to query back from the new column when you run the mutation.

mutation {
  create_column(
    board_id: 1234567890
    title: "Keywords"
    column_type: dropdown
    description: "This column indicates which keywords to include in each project."
    defaults: "{\"settings\":{\"labels\":[{\"id\":1,\"name\":\"Technology\"}, {\"id\":2,\"name\":\"Marketing\"}, {\"id\":3,\"name\":\"Sales\"}]}}"
  ) {
    id
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query = `mutation ($board: ID!, $title: String!, $desc: String!, $defaults: JSON!, $type: ColumnType!) { create_column(board_id: $board, title: $title, column_type:$type, description: $desc, defaults: $defaults){ id } }`;
const variables = {
  board: 9571351437,
  title: "Locations",
  type: "dropdown",
  desc: "Retail locations that will run the ad campaign",
  defaults: JSON.stringify({
    settings: {
      labels: [
        {
          id: 1,
          name: "SoHo",
        },
        {
          id: 2,
          name: "Prospect Heights",
        },
        {
          id: 3,
          name: "Midwood",
        },
        {
          id: 4,
          name: "Sunnyside",
        },
      ],
    },
  }),
};
const response = await mondayApiClient.request(query, variables);

Arguments

You can use the following arguments to define the new column's characteristics.

ArgumentDescription
board_id ID!The unique identifier of the board where the new column should be created.
column_type ColumnType!The type of column to create.
defaults JSONThe new column's defaults.
description StringThe new column's description.
id StringThe column's user-specified unique identifier. The mutation will fail if it does not meet any of the following requirements:

- [1-20] characters in length (inclusive)
- Only lowercase letters (a-z) and underscores (_)
- Must be unique (no other column on the board can have the same ID)
- Can't reuse column IDs, even if the column has been deleted from the board
- Can't be null, blank, or an empty string
title String!The new column's title.

Filter by the dropdown column

Using the items_page object, you can easily filter a board's items by specific columns or column values. The table below contains the dropdown column's supported operators and compare values.

OperatorsCompare values
any_of
  • "" (blank values)
  • The label IDs to filter by
  • not_any_of
  • ""(blank values)
  • The label IDs to filter by
  • is_emptynull
    is_not_emptynull
    contains_textThe partial or whole label text value to filter by
    not_contains_textThe partial or whole label text value to filter by

    Examples

    The following example returns all items on the specified board with the label "Marketing" or a label that contains "Marketing."

    query {
      boards (ids: 1234567890) {
        items_page (query_params: {rules: [{column_id: "dropdown", compare_value: ["Marketing"], operator:contains_text}]}) {
          items {
            id
            name
          }
        }
      }
    }
    
    import { ApiClient } from "@mondaydotcomorg/api";
    const mondayApiClient = new ApiClient({ token: myToken });
    
    const query = `query ($board_id: [ID!], $column_id: ID!, $operator: ItemsQueryRuleOperator!, $compare_value:CompareValue!) { boards (ids: $board_id) { items_page (query_params: {rules: [{column_id: $column_id, compare_value: $compare_value,  operator:$operator}]}) { items { id name } } } }`;
    const variables = {
      board_id: 9571351437,
      column_id: "dropdown_mksrbr89",
      compare_value: ["Marketing"], 
      operator: "contains_text",
    };
    
    const response = await mondayApiClient.request(query, variables);
    

    Update the dropdown column

    You can update a dropdown column with a simple string value or a JSON string value.

    ❗️

    NOTE

    It is not possible to mix dropdown labels (the text values) with dropdown IDs in the string values.

    Simple strings

    Send the IDs of the labels you want to set to update a dropdown column with strings. If you don’t know the IDs of the labels you’re trying to set, you can send the label's text value instead. If you need to update more than one value, you can also send a list of IDs or labels separated by commas.

    If you make an API call to update the dropdown column value, but the label doesn't exist, the expected behavior will be an error message. In the output of that error, you will also receive the existing labels for that specific column. However, you can use create_labels_if_missing: true in your query to create labels that didn't previously exist.

    Here is a sample query to update the dropdown column using simple string values via dropdown IDs.

    mutation {
      change_simple_column_value (item_id:9876543210, board_id:1234567890, column_id:"dropdown", value: "1,2") {
        id
      }
    }
    
    const query = `mutation ($myBoardId:ID!, $myItemId:ID!, $myColumnValue: String!, $myColumnId: String!) { change_simple_column_value (item_id:$myItemId, board_id:$myBoardId, column_id: $myColumnId, value: $myColumnValue) { id } }`;
    const variables = {
      myBoardId: 9571351437,
      myItemId: 9571351485,
      myColumnId: "dropdown_mksrbr89",
      myColumnValue: "1,2",
    };
    
    const response = await mondayApiClient.request(query, variables); 
    

    Here is a sample query to update the dropdown column using simple string values with dropdown labels.

    mutation {
      change_simple_column_value (item_id:9876543210, board_id:1234567890, column_id:"dropdown", value: "Cookie, Cupcake") {
        id
      }
    }
    
    const query = `mutation ($myBoardId:ID!, $myItemId:ID!, $myColumnValue: String!, $myColumnId: String!) { change_simple_column_value (item_id:$myItemId, board_id:$myBoardId, column_id: $myColumnId, value: $myColumnValue) { id } }`;
    const variables = {
      myBoardId: 9571351437,
      myItemId: 9571351485,
      myColumnId: "dropdown_mksrbr89",
      myColumnValue: "Sunnyside,Midwood",
    };
    
    const response = await mondayApiClient.request(query, variables); 
    
    curl "https://api.monday.com/v2" \
    -X POST \
    -H "Content-Type:application/json" \
    -H "Authorization: MY_API_KEY" \
    -d '{"query":"mutation{change_simple_column_value (item_id:9876543210,board_id:1234567890, column_id: \"dropdown\", value: \"Cookie, Cupcake\"){ name id}}"}'
    

    JSON

    You can also update the dropdown column using JSON values with either the ID value or the text label.

    👍

    Pro tip

    You can use both String and JSON values when updating column values for change_multiple_column_values mutation, or when using the create_item mutation.

    Here is a sample query to update the dropdown column using JSON values with dropdown IDs.

    mutation {
      change_multiple_column_values(item_id:9876543210, board_id:1234567890, column_values: "{\"dropdown\": {\"ids\":[\"1\"]}}") {
        id
      }
    }
    
    import { ApiClient } from "@mondaydotcomorg/api";
    const mondayApiClient = new ApiClient({ token: myToken });
    
    const query = `mutation ($myBoardId:ID!, $myItemId:ID!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id } }`;
    const variables = {
      myBoardId: 9571351437,
      myItemId: 9571351485,
      myColumnValues: JSON.stringify({
        dropdown_mksrbr89: { // dropdown_mksrbr89 is the column ID
          ids: ["3"]
        } 
      }),
    };
    
    const response = await mondayApiClient.request(query, variables);
    

    Here is a sample query to update the dropdown column using JSON values with dropdown labels.

    mutation {
      change_multiple_column_values(item_id:9876543210, board_id:1234567890, column_values: "{\"dropdown\":{\"labels\":[\"My label\"]}}") {
        id
      }
    }
    
    import { ApiClient } from "@mondaydotcomorg/api";
    const mondayApiClient = new ApiClient({ token: myToken });
    
    const query = `mutation ($myBoardId:ID!, $myItemId:ID!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id } }`;
    const variables = {
      myBoardId: 9571351437,
      myItemId: 9571351485,
      myColumnValues: JSON.stringify({
        dropdown_mksrbr89: { // dropdown_mksrbr89 is the column ID
          labels: ["Sunnyside", "Midwood"]
        } 
      }),
    };
    

    Add a dropdown value

    You can add a new dropdown value to a column using the following mutation:

    mutation {
      change_simple_column_value(item_id:1234567890, board_id:9876543210, column_id: "dropdown", value: "New dropdown value", create_labels_if_missing: true) {
        id
      }
    }
    

    Arguments for adding a dropdown value

    ArgumentDescription
    item_id Int!The item's unique identifier.
    board_id Int!The board's unique identifier.
    column_id Int!The column's unique identifier.
    value String!The new value of the column.
    create_labels_if_missing BooleanCreate status/dropdown labels if they're missing. (Requires permission to change board structure)

    Clear a dropdown column

    You can clear a dropdown column using the following mutation:

    mutation {
      change_multiple_column_values(item_id:123456789, board_id:987654321, column_values: "{\"dropdown\" : null}") {
        id
      }
    }
    
    mutation {
      change_multiple_column_values(item_id:123456789, board_id:987654321, column_values: "{\"dropdown\":{\"labels\":[]}}") {
        id
      }
    }