Timill Platform Documentation

Field values

What item.getField returns and item.setField accepts for every field type, in JavaScript and Gonja.

item.getField(fieldId) reads any field of an item — a built-in field such as title or assignee, or a custom field by its field id — and returns a plain value: a string, a number, a boolean, null, an array or a plain object. The shape depends on the field’s type and is the same in JavaScript and in Gonja templates.

In backend scripts, item.setField(fieldId, value) accepts the same shapes, so a value you read can be written back as is. Values are converted and validated exactly as when a person edits the field; a value the field cannot hold is refused with {success: false, error} instead of being stored.

Tip

Field ids are per group. Find them in the group’s item type settings, or list them from a script with group.getFields(itemTypeId), which returns {id, name, description, type, icon} for every field of the type.

Values by field type#

Field typegetField returnsUnsetsetField also accepts
Text (string)"text"null
Rich text (html)"<p>html</p>"null; built-in description ""
Number42.5nulla numeric string
Booleantrue / falsenull
Date (dateOnly)"2026-05-06T00:00:00Z"null"2026-05-06"
Date and time (dateTime)"2026-05-06T08:00:00Z" (always UTC)nullany RFC 3339 string, e.g. "2026-05-06T10:00:00+02:00"
Statusthe status id, "open"null
Userthe user idnull
Users["userId", …][]
Item referencethe item idnull
Item references["itemId", …][]
Group referencethe group idnull
Group references["groupId", …][]
Dropdownthe option idnull
Dropdowns (multi)["optionId", …][]
Eventan event objectnull
Eventsan array of event objects[]
Attachmentan attachment objectnullnot writable with setField
Attachmentsan array of attachment objects[]not writable with setField

setField(fieldId, null) clears a field.

Important

Dropdown, status and reference values are ids, not the labels people see. item.getField("priority") === "high" compares against the option id. To show a value the way the app does, use item.renderField(fieldId), which returns the platform’s own HTML for it.

Built-in fields#

The built-in fields follow the same table. Their ids and types:

Field idTypeNotes
idtextthe item’s unique id — set by the platform
titletextcannot be cleared
descriptionrich text
statusstatuscannot be cleared
typetextthe item type id
groupgroup referencethe item’s own group — set by the platform
idInGroupnumberthe number in the item’s tag (#12, PRJ-12) — set by the platform
assigneeuser
authoruser
subscribersusers
dueDatedate
createddate and time
updateddate and timeset by the platform on every change
completedDatedate and time
attachmentsattachmentsuse the file API

Most built-in fields are also exposed as properties on the item object — item.title, item.status, item.assignedTo, item.dueDate and so on. The two agree on value, with one difference in Gonja: date properties are time values there, while getField returns ISO strings. Both work with the date() and datetime() functions. See the JavaScript API and the Gonja reference.

Events#

An event field holds calendar entries. Each one reads as:

{
  "id": "evt_4f1c…",
  "title": "Kickoff",
  "description": "",
  "start_time": "2026-05-06T10:00:00Z",
  "end_time": "2026-05-06T11:00:00Z",
  "all_day": false,
  "location": "",
  "attendees": [],
  "categories": [],
  "url": ""
}

The keys are the ones the REST API uses. To write an event, pass an object with at least start_time; id is generated when missing, and a date-only start_time ("2026-12-25") is accepted, especially with all_day: true. A single event field takes one object; an events field takes an array.

item.setField("kickoff", { title: "Kickoff", start_time: "2026-12-01T09:00:00Z", end_time: "2026-12-01T10:00:00Z" });
item.setField("milestones", [{ title: "Beta", start_time: "2027-01-15", all_day: true }]);

Attachments#

Each file on an attachment field reads as:

{
  "id": "66f1c2…",
  "filename": "invoice.pdf",
  "contentType": "application/pdf",
  "size": 48213,
  "uploadDate": "2026-09-23T12:00:00Z",
  "author": "userId",
  "version": 1,
  "versionGroup": "66f1c2…",
  "fieldId": "attachments",
  "url": "/groupId/attachments/itemId/66f1c2…"
}

Deleted files are not listed. url is the in-app download path; use it as a link or an image source. Files are added, removed and read with dedicated methods — see Files and attachments.

Examples#

// JavaScript
const owner = item.getField("assignee");            // "userId" or null
const reviewers = item.getField("reviewers");       // always an array
if (reviewers.length === 0 && owner) {
  item.setField("reviewers", [owner]);
}
const due = item.getField("dueDate");               // ISO string or null
if (due && new Date(due) < new Date()) {
  item.setField("overdue", true);
}
{# Gonja #}
{% for it in group.queryItems("completedDate:$empty") %}
  <li>{{ it.title }} — due {{ date(it.getField("dueDate")) }},
      {{ it.getField("attachments") | length }} file(s)</li>
  {# date() prints nothing when the date is unset #}
{% endfor %}