Learn how to filter by and read the vote column on monday boards using the platform API
The vote column allows board subscribers and team members to vote on items.
Via the API, the vote column supports read and filter operations.
Column Type | Implementation Type | Supported Operations |
|---|---|---|
|
|
|
Queries
Vote columns can be queried through the column_values field on items queries using an inline fragment on VoteValue.
query {
items(ids: [1234567890, 9876543210]) {
column_values {
... on VoteValue {
vote_count
voter_ids
}
}
}
}Fields
You can use the following fields to specify what information your VoteValue implementation will return.
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
id ID! | The column's unique identifier. |
text String | The column's value as text. Returns "0" if the column has no votes. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | The column's JSON-formatted raw value. |
vote_count Int! | The total number of votes. |
voters [User!]! | The users who voted. |
voter_ids [ID!]! | The unique identifiers of users who voted. |
Filter
You can filter items by vote values using the items_page object. The vote column supports the following operators:
Operators | Compare Values |
|---|---|
|
|
|
|
|
|
|
|
Example
The following example returns all items that user 123456 voted for.
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "vote"
compare_value: [123456]
operator: any_of
}
]
}
) {
items {
id
name
}
}
}
}