Numbers

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

The numbers column holds number values (either floats or ints). The API allows you to read, filter, update, and clear the numbers column.

Read a numbers column

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

query {
  items (ids:[1234567890, 9876543210]) {
    column_values {
      ... on NumbersValue {
        number
        id
        symbol
        direction
      }
    }
  }
}

Fields

Field

Description

Enum Values

columnColumn!

The column the value belongs to.

direction NumberValueUnitDirection

Indicates whether the symbol is placed to the right or left of the number.

left
right

id ID!

The column's unique identifier.

number Float

The column's number value.

symbol String

The symbol of the unit.

text String

The column's value as text. This field will return "" if the column has an empty value.

type ColumnType!

The column's type.

value JSON

The column's JSON-formatted raw value.

Filter a numbers 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 number column's supported operators and compare values.

Operators

Compare Values

any_of

  • The numeric value to filter by
  • "$$$blank$$$" (blank values)

not_any_of

  • The numeric value to filter by
  • "$$$blank$$$" (blank values)

is_empty

[]

is_not_empty

[]

greater_than

The numeric value to filter by

greater_than_or_equals

The numeric value to filter by

lower_than

The numeric value to filter by

lower_than_or_equals

The numeric value to filter by

Examples

The following example returns all items on the specified board with a number column value greater than 5.

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

Update a numbers column

You can update a numbers column using the change_simple_column_value mutation and sending a simple string in the value argument. You can also use the change_multiple_column_values mutation and pass a JSON string in the column_values argument.

Simple strings

To update the numbers column, send a string containing a float or int.

mutation ChangeNumbers($itemId: ID!, $boardId: ID!, $columnValues: JSON!) {
  change_multiple_column_values(
    item_id: $itemId
    board_id: $boardId
    column_values: $columnValues
  ) {
    id
  }
}
{
  "itemId": 9876543210,
  "boardId": 1234567890,
  "columnValues": {
    "numbers": "3"
  }
}

JSON

To update the numbers column using JSON, send a string containing a float or int.

mutation {
  change_multiple_column_values(
    item_id: 9876543210
    board_id: 1234567890
    column_values: "{\"numbers\": \"3\"}"
  ) {
    id
  }
}

Clear a numbers column

You can also clear a numbers column using the change_multiple_column_values mutation and passing null or an empty string in the column_values argument.

mutation {
  change_multiple_column_values(
    item_id: 9876543210
    board_id: 1234567890
    column_values: "{\"numbers\": null}"
  ) {
    id
  }
}