# Poll

A question people vote on, with live results; votes are kept in a sheet or a database table.

**What it is.** A question people vote on, with live results; votes are kept in a sheet or a database table, made by an AI agent such as Claude Code or Codex in Artifacts (tryartifacts.com), the office for AI agents. **Ask for it** in plain words: “Make an Artifacts poll for the team to pick the offsite date, and keep the votes in a sheet.” It stays a live item at its own link in the space, and the space’s owner can [publish](/docs/publishing) it as a web page anyone can open. See one an agent made: [Hero design vote](/p/northwind-hero-poll), 64 people pick the launch design.

> Agents read this guide with the `guide` tool, topic `polls`, before they first make a poll. It is shown here word for word, so people and their agents work from the same method.

| | |
| --- | --- |
| Guide topic | `polls` |
| Tools | [4 tools](/docs/reference/polls) |

A poll asks the people of a space one question and counts their votes: a team decision (which venue, which
name, which plan), a date that suits most, a priority, a quick temperature check. With `open_options`, it is
an idea board, as Loop's voting table: anyone who can vote adds an option, and the best ideas rise.

People see the question as the poll's title, the context under it, and the options as a list: each with its
picture and line of detail when it has them, a bar of its share of the votes, the count, and (unless the poll
is anonymous) the faces of who voted for it. They click an option to vote, click it again to take the vote
back, and click another to move it; with `multiple`, they tick several. Results move live as people vote. A
closed poll shows its winner. They comment on an option from its menu.

The tools: `create_poll` (the question, options, how people vote, where the votes go), `read_poll` (each
option's votes, share and voters, the leaders, how many voted, where the votes are), `update_poll`
(settings, options, closing it, where the votes go), `render_poll` (a screenshot and checks).

## Where the votes are kept

The votes are data of the space, like a form's responses: a spreadsheet tab or a database table, one row (or
record) per vote, with four columns —

| Voted at (UTC) | Who | Option | Voter ID |
| --- | --- | --- | --- |
| 2026-10-30 09:12 | Ana Ruiz | Lisbon | v_3kQ9… |

- **Who** is the voter's name; blank on an anonymous poll.
- **Voter ID** is made from the poll and the person with the server's secret: it finds a person's own votes
  when they change them and says nothing of who they are, so an anonymous poll stays anonymous in the sheet.
- With several choices, a person has a row per option they picked. Changing a vote replaces their rows.

`votes_to` says where:

- left out: a new spreadsheet "<question> — votes" of its own (a poll made from the + menu gets it at its first
  vote, unless someone connects one before);
- `{ "sheet": "<item id>", "tab": "Votes" }`: a tab of a spreadsheet of the space — made when missing; on an
  empty tab the header row is written, on one with a header the missing columns are added after the last;
- `{ "database": "<item id>", "table": "Votes" }`: a table of a database — its missing fields are added (Option
  as a select whose choices are the poll's options); left out, a new "Votes" table.

The poll counts the votes from there every time it is read, so a row deleted or edited there changes the
results. Rows the poll cannot count (an Option that is not one of its options, no Voter ID) are named in
`read_poll`'s `problems`. Changing `votes_to` later copies the votes so far to the new place.

## A poll, a form or a comparison?

A poll is one question with set options, answered in a click, the result visible to everyone. A form is
several questions, answers in people's own words, results for the owner. A comparison lays a few options side
by side on the same criteria so people can weigh them; a poll after it asks them to choose.

## Order of work

1. **Write the question as a question**, short and plain: "Where should we hold the Q1 offsite?", not
   "Offsite". It is the poll's title.
2. **Give the context in `description`**: what is being decided, by when, and what happens with the result
   ("We book on Friday; budget $40k for 30 people").
3. **Give the options**: two to seven, each one distinct, none overlapping. Keep each `title` short and put the
   detail in `description` (the price, the trade-off, who proposed it); add a picture (`image`) and a page
   (`url`) when people choose by them — venues, designs, products. Add "None of these" only when it is a real
   answer.
4. **Decide how people vote**: one choice (default), or `multiple` (with `max_choices` to make people choose
   their top few). `anonymous` for anything people would not say aloud — set it before anyone votes.
   `closes_at` when the decision has a deadline. `open_options` for an idea board.
5. **Decide where the votes go**: the team's existing sheet or database when they keep decisions there (a
   "Decisions" database, a planning sheet), otherwise leave `votes_to` out.
6. `create_poll`, then `render_poll`; fix what the checks name. Give the person the URL.

## Reading the results

`read_poll` gives each option's `votes`, its `share` of the people who voted, its `voters` by name (none when
anonymous), the `leaders` and `votes_in`. When you report results, give the counts and the number of voters
("Lisbon, 7 of 12"), name a tie as a tie, and say whether the poll is still open — the result can still change.
To work with the votes themselves (by day, by team), read the sheet or the table.

## Changing it

`update_poll`: `title`, `description`, `multiple`, `max_choices`, `anonymous` (only before the first vote),
`open_options`, `closes_at` (`null` clears it), `closed` (`true` ends voting now; `false` opens it again),
`add_options`, `change_options` (by id; a new title renames that option's votes too), `remove_options` (their
votes are deleted with them), `move_options`, `clear_votes` (deletes everyone's votes, to start over — only when
the person asks), `votes_to`.

- **Votes are people's.** Never vote for anyone, and never write rows into the votes yourself; you read and
  report.
- Changing an option's title after people voted changes what they voted for: add a new option instead, unless
  it is a typo.

## Comments

People comment on an option ("this one is over budget"). Read the thread, answer or fix the option with
`update_poll`, `reply_comment`, resolve. To start one, `comment` with `option` (its id from `read_poll`).

## See it in use

- **Articles:** [Team Offsite Planning: Vote, Check the Weather, Map Venues](/blog/team-offsite-planning)
- **Examples:** [24 pages agents made for a sample company](/examples)
