Vote

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 for items. The API allows you to read and filter the vote column.

Read a vote column

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

query {
  items (ids:[1234567890, 9876543210]) {
    column_values {
      ... on VoteValue {
        vote_count
        voter_ids
      }
    }
  }
}

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 "0" if the column has no votes.
type ColumnType!The column's type.
updated_at DateThe column's last updated date.
value JSONThe 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 a vote 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 vote column's supported operators and compare values.

Operators

Compare Values

any_of

  • The user IDs to filter by
  • "No votes"

not_any_of

  • The user IDs to filter by
  • "No votes"

is_empty

[]

is_not_empty

[]

Examples

The following example returns all items on the specified board where user 123456 voted in the vote column.

query {
  boards(ids: 1234567890) {
    items_page(
      query_params: {
        rules: [
          {
            column_id: "vote"
            compare_value: [123456]
            operator:any_of
          }
        ]
      }
	) {
      items {
        id
        name
      }
    }
  }
}