Learn how to filter, read, update, and clear the email column on monday boards using the platform API
The email column allows you to attach an email address to an item and send emails to that contact with a single click.
Via the API, the email column supports read, filter, create, update, and clear operations.
Column Type | Implementation Type | Supported Operations |
|---|---|---|
|
|
|
Queries
Email columns can be queried through the column_values field on items queries using an inline fragment on EmailValue.
query {
items (ids:[1234567890, 9876543210]) {
column_values {
... on EmailValue {
email
updated_at
}
}
}
}const query = `query($itemIds: [ID!], $columnType:[ColumnType!]) { items (ids:$itemIds) { id column_values (types:$columnType) { column { title id } ... on EmailValue { email } } } }`;
const variables = {
itemIds: [9571351485, 9572374902],
columnType: "email"
};
const response = await mondayApiClient.request(query, variables);Fields
You can use the following fields to specify what information your EmailValue implementation will return.
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
email String | The column's email value. |
id ID! | The column's unique identifier. |
label String | The column's text value. Please note that this may be the same as the email value if the user didn't enter any text. |
text String | The column's value as text. Returns "" if the column has an empty value. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | The column's JSON-formatted raw value. |
Filter
You can filter items by email values using the items_page object. The email column supports the following operators:
Operators | Compare Values |
|---|---|
|
|
|
|
|
|
|
|
| Partial or full email or display text value |
| Partial or full email or display text value |
*You can filter by either the email or the display text when using any_of, not_any_of, contains_text, or not_contains_text, but the value must match what appears in the UI. If the item only has an email, you can filter it. If display text is present, you must filter by the display text instead of the email.
Example
The following example returns all items that do not contain “@gmail” in their email address. If the column uses display text instead of the raw email, the filter must match the display text value.
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "email"
compare_value: ["@gmail"]
operator: not_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: "email_mksr9hcd",
compare_value: ["@gmail.com"],
operator: "contains_text",
};
const response = await mondayApiClient.request(query, variables);Mutations
Update
You can update an email 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
change_simple_column_valueSend both the email address and display text as a string separated by a space. You can also include spaces in the display text. Both are required.
mutation {
change_simple_column_value(
item_id: 9876543210
board_id: 1234567890
column_id: "email"
value: "[email protected] This is an example email"
) {
id
}
}import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });
const query = `
mutation (
$boardId: ID!,
$itemId: ID!,
$columnId: String!,
$columnValue: String!
) {
change_simple_column_value(
item_id: $itemId,
board_id: $boardId,
column_id: $columnId,
value: $columnValue
) {
id
}
}
`;
const variables = {
boardId: 9571351437,
itemId: 9571351485,
columnId: "email_mksr9hcd",
columnValue: "[email protected] This is an example email",
};
const response = await mondayApiClient.request(query, variables);change_multiple_column_values
change_multiple_column_valuesSend the email and text keys as a JSON object in column_values. Both keys are required.
Pro tipYou can mix both string and JSON values in the
change_multiple_column_valuesmutation.
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"email_mksr9hcd\": {\"email\": \"[email protected]\", \"text\": \"This is an example email\"}}"
) {
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({
email_mksr9hcd: { // Replace with your email column ID
email: "[email protected]",
text: "This is an example email"
}
}),
};
const response = await mondayApiClient.request(query, variables);Clear
You can clear an email column using change_simple_column_value or change_multiple_column_values.
change_simple_column_value
change_simple_column_valuePass an empty string in value.
mutation {
change_simple_column_value(
item_id: 9876543210
board_id: 1234567890
column_id: "email"
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: "email",
columnValue: ""
};
const response = await mondayApiClient.request(query, variables);change_multiple_column_values
change_multiple_column_valuesPass null or an empty string/object in column_values.
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"email\": null}"
) {
id
}
}