Learn how to filter by, read, update, and clear the people column on monday boards using the platform API
The people column assigns one or more users or teams to an item.
Via the API, the people column supports read, filter, create, update, and clear operations.
Column Type | Implementation Type | Supported Operations |
|---|---|---|
|
|
|
Queries
People columns can be queried through the column_values field on items queries using an inline fragment on PeopleValue.
query {
items(ids: [1234567890, 9876543210]) {
column_values {
... on PeopleValue {
persons_and_teams {
id
kind
}
}
}
}
}Fields
You can use the following fields to specify what information your PeopleValue implementation will return.
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
id ID! | The column's unique identifier. |
persons_and_teams [PeopleEntity!] | The assigned people or teams. |
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 people values using the items_page object. The people column supports the following operators:
Operators | Compare Values |
|---|---|
|
|
|
|
|
|
|
|
| Partial or full name (must match the UI) |
| Partial or full name to exclude (must match the UI) |
| Matches names by keyword(s) in any order |
| Name starts with the compare value |
| Name ends with the compare value |
Example
This example returns items assigned to anyone except the user making the API call.
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "people"
compare_value: ["assigned_to_me"]
operator: not_any_of
}
]
}
) {
items {
id
name
}
}
}
}Mutations
Update
You can update a people 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 a comma-separated list of user IDs as a string in value.
mutation {
change_simple_column_value(
item_id: 9876543210
board_id: 1234567890
column_id: "people"
value: "123456,654321"
) {
id
}
}change_multiple_column_values
change_multiple_column_valuesSend people or team IDs as JSON objects with id and kind keys in column_values.
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"people\": {\"personsAndTeams\": [{\"id\": 4616666, \"kind\": \"person\"}, {\"id\": 51166, \"kind\": \"team\"}]}}"
) {
id
}
}Clear
You can clear a people 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: "people"
value: ""
) {
id
}
}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: "{\"people\": null}"
) {
id
}
}