Long Text

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

The long text column holds up to 2,000 characters of text.

Via the API, the long text column supports read, filter, update, and clear operations.

Column Type

Implementation Type

Supported Operations

long_text

LongTextValue

  • Read: Yes
  • Filter: Yes
  • Update: Yes
  • Clear: Yes

Queries

Long text columns can be queried through the column_values field on items queries using an inline fragment on LongTextValue.

query {
  items(ids: [1234567890, 9876543210]) {
    column_values {
      ... on LongTextValue {
        text
        value
      }
    }
  }
}

Fields

You can use the following fields to specify what information your LongTextValue implementation will return.

FieldDescription
column Column!The column the value belongs to.
id ID!The column's unique identifier.
text StringThe column's long text. Returns "" if the column has an empty value.
type ColumnType!The column's type.
updated_at DateThe column's last updated date.
value JSONThe column's JSON-formatted raw value.

Filter

You can filter items by long text values using the items_page object. The link column supports the following operators:

Operators

Compare Values

any_of

  • Full text value to include
  • "" (blank values)

not_any_of

  • Full text value to exclude
  • "" (blank values)

is_empty

[]

is_not_empty

[]

contains_text

Partial or full text value to filter by

not_contains_text

Partial or full text value to exclude

Example

The following example returns all items on the specified board with an empty long text column.

query {
  boards(ids: 1234567890) {
    items_page(
      query_params: {
        rules: [
          {
            column_id: "long_text"
            compare_value: []
            operator: is_empty
          }
        ]
      }
    ) {
      items {
        id
        name
      }
    }
  }
}

Mutations

Update

You can update a long text column using the change_simple_column_value or change_multiple_column_values mutations. You can send values as simple strings or JSON objects, depending on the mutation you choose.

change_simple_column_value

Send a string with up to 2,000 characters.

mutation {
  change_simple_column_value(
    item_id: 9876543210
    board_id: 1234567890
    column_id: "long_text"
    value: "Sample text"
  ) {
    id
  }
}

change_multiple_column_values

Send the text key with up to 2,000 characters as a JSON object in column_values..

mutation {
  change_multiple_column_values(
    item_id: 9876543210
    board_id: 1234567890
    column_values: "{\"long_text\": {\"text\": \"Sample text\"}}"
  ) {
    id
  }
}

Clear

You can clear a long text column using change_simple_column_value or change_multiple_column_values.

change_simple_column_value

Pass an empty string in value.

mutation {
  change_simple_column_value(
    item_id: 9876543210
    board_id: 1234567890
    column_id: "long_text"
    value: ""
  ) {
    id
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query = `
  mutation ($boardId: ID!, $itemId: ID!, $columnValue: String!, $columnId: String!) {
    change_simple_column_value(
      item_id: $itemId
      board_id: $boardId
      column_id: $columnId
      value: $columnValue
    ) {
      id
    }
  }
`;

const variables = {
  boardId: 9571351437,
  itemId: 9571351485,
  columnId: "date_mksr13fh",
  columnValue: "",
};

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

change_multiple_column_values

Pass null or an empty string/object in column_values.

mutation {
  change_multiple_column_values(
    item_id: 9876543210
    board_id: 1234567890
    column_values: "{\"long_text\": null}"
  ) {
    id
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query = `
  mutation ($boardId: ID!, $itemId: ID!, $columnValues: JSON!) {
    change_multiple_column_values(
      item_id: $itemId
      board_id: $boardId
      column_values: $columnValues
    ) {
      id
    }
  }
`;

const variables = {
  boardId: 9571351437,
  itemId: 9571351485,
  columnValues: JSON.stringify({
    date_mksr13fh: null
  }),
};

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