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 link to a webpage. The API allows you to read, filter, update, and clear the link column.

Read a link column

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

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

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 "" 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

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

Operators

Compare value

any_of

  • "" (blank values)
  • The whole URL or display text value to filter by

not_any_of

  • "" (blank values)
  • The whole URL or display text value to filter by

is_empty

null

is_not_empty

null

contains_text

The partial or whole URL or display text value to filter by*

not_contains_text

The partial or whole URL or display text value to filter by*

*Please note that you can use either the URL or display text when using theany_of, not_any_of, contains_text, or not_contains_text operators, but it must match whatever is in the UI. For example, if the item just has a URL without display text, you can search by the URL. If display text is present, you must search by that and not the URL.

Examples

The following example returns all items on the specified board with link column label that contains "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 ($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: "link",
  compare_value: ["Google"], 
  operator: "contains_text",
};

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

Update the link column

You can update a link 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 a link column, send the URL (including HTTP/HTTPS) and the display text separated with a space. You can include spaces in the display text.

mutation {
  change_simple_column_value (item_id:9876543210, board_id:1234567890, column_id:"link", value: "http://monday.com go to monday!") {
    id
  }
}
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });

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

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

JSON

To update a link column, write the URL (including HTTP/HTTPS) in the URL key and the display text in the text key.

mutation {
  change_multiple_column_values(item_id:9876543210, board_id:1234567890, column_values: "{\"link\" : {\"url\" : \"http://monday.com\", \"text\":\"go to monday!\"}}") {
    id
  }
}
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({
    link_1233: { // link_1233 is the column ID
      "url": "https://monday.com",
      "text": "Open monday"
    }
  }),
};

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

Clear a link column

You have two options to clear a link column. First, you use the change_multiple_column_values mutation and pass null, an empty string, or an empty object in the column_values argument.

mutation {
  change_multiple_column_values(item_id:9876543210, board_id:1234567890, column_values: "{\"link\" : null}") {
    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({
    link_1233: null
  }),
};

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

You can also use the change_simple_column_value mutation and pass an empty string in the value argument.

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

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: "link",
  myColumnValue: "",
};

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