Add or edit a record
Add a record to a collection, or change one, with the form built from the collection's schema.
Where: Database → Collections → collection → Add New (or Edit on a row) · /projects/<project>/db/collections/<collection>/records/new · …/records/<recordId>/edit
Before you start
The collection's schema is published — see Create a schema. Add New is off while the schema is only a draft.
You need
database:createon the collection (database:collection:<name>) to add,database:updateto edit.
Steps
Open Database → Collections, click the collection, and press Add New. The form is titled Add New Record — books (v1): the collection and its published version. Its fields, widgets and tabs come from the schema.

The empty record form of books. Fill in the fields. Switch tabs, if the schema has several, to reach every field.
FieldRequiredWhat it doesExampleTitle
yes
Text, at most 200 characters.
The DispossessedPages
yes
A whole number, 0 or more.
387In stock
no
Yes / no.
ticked
Genre
no
One value of the list
fiction,science,history.fiction
The form, filled in. Press Create. Required fields and formats are checked first; an invalid form is not sent. Cancel goes back without saving.
Result
Cloud goes back to the records list, and the new record is the first row (newest first, unless the List tab sets another sort). The record gets an id (6ac4f314f002ebc3670fbf05), and every schema trigger When inserted runs.

Change or remove it later
Edit — press Edit on the row. The form is titled Edit Record — books (v1), shows the saved values, and its button is Update. Change the values and press Update; When updated triggers run.

Editing a record. Delete — Delete at the top right of the edit form, or Delete... on the row — see Delete a record.
The record's owner (schema setting Records have an owner) is not changed here; use
changeResponsibilityfrom code.
The API checks inserts and updates against the published schema: a value the schema forbids is refused, from Cloud and from code.
Do it from code
updateOne takes the fields to change, not $ operators (CM-ERRORS-DATABASE-035). The client setup is on the Database page. API: Insert One · Update One · Replace One · Change Responsibility
Last updated
Was this helpful?