Link

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

The link column stores a URL and optional display text for an item.

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

Column Type

Implementation Type

Supported Operations

link

LinkValue

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

Queries

Link columns can be queried through the column_values field on items queries using an inline fragment on LinkValue.

query {
  items(ids: [1234567890, 9876543210]) {
    column_values {
      ... on LinkValue {
        url
        url_text
      }
    }
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query = `
  query($itemIds: [ID!], $columnType: [ColumnType!]) {
    items(ids: $itemIds) {
      id
      column_values(types: $columnType) {
        column { title id }
        ... on LinkValue {
          url
          url_text
        }
      }
    }
  }
`;

const variables = {
  itemIds: [9571351485, 9572374902],
  columnType: "link"
};

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

Fields

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

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

Filter a link column

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

Operators

Compare Value

any_of

  • "" (blank values)
  • Full URL or display text value

not_any_of

  • "" (blank values)
  • Full URL or display text value

is_empty

[]

is_not_empty

[]

contains_text

Partial or full URL or display text*

not_contains_text

Partial or full URL or display text*

👍

When filtering by any_of, not_any_of, contains_text, or not_contains_text, you can use the URL or the display text, but it must match what appears in the UI.

  • If only a URL is stored, filter by the URL.
  • If display text is present, the filter must use that text instead of the URL.

Example

The following example returns items whose link column contains the text "Google":

query {
  boards(ids: 1234567890) {
    items_page(
      query_params: {
        rules: [
          {
            column_id: "link"
            compare_value: ["Google"]
            operator: contains_text
          }
        ]
      }
    ) {
      items {
        id
        name
      }
    }
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

const query = `
  query ($boardId: [ID!], $columnId: ID!, $operator: ItemsQueryRuleOperator!, $compareValue: CompareValue!) {
    boards(ids: $boardId) {
      items_page(
        query_params: {
          rules: [
            { column_id: $columnId, compare_value: $compareValue, operator: $operator }
          ]
        }
      ) {
        items { id name }
      }
    }
  }
`;

const variables = {
  boardId: 9571351437,
  columnId: "link_mksr1234",
  compareValue: ["Google"],
  operator: "contains_text"
};

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

Mutations

Update

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

change_simple_column_value

To update a link column with a simple string, send the URL (including http:// or https://) and the display text separated by a space. The display text may contain spaces.

mutation {
  change_simple_column_value(
    item_id: 9876543210
    board_id: 1234567890
    column_id: "link"
    value: "https://monday.com go to monday!"
  ) {
    id
  }
}
import { ApiClient } from "@mondaydotcomorg/api";

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: "link",
  columnValue: "https://monday.com go to monday!"
};

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

change_multiple_column_values

To update a link column with JSON, send both the URL (including http:// or https://) display text explicitly.

mutation {
  change_multiple_column_values(
    item_id: 9876543210
    board_id: 1234567890
    column_values: "{\"link\": {\"url\": \"https://monday.com\", \"text\": \"Go to monday!\"}}"
  ) {
    id
  }
}
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({
    link_mksr1234: { // replace with your link column ID
      url: "https://monday.com",
      text: "Go to monday!"
    }
  })
};

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

Clear

You can clear a link 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: "link"
    value: ""
  ) {
    id
  }
}
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: "link",
  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: "{\"link\": null}"
  ) {
    id
  }
}
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({
    link_mksr1234: null
  })
};

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