Unsaved input comes back
->drafts() keeps what people type in the browser (a second after they stop typing) and offers it back when they open the form again: after a reload, a closed tab, a browser crash or an expired session. The draft is deleted once the form is saved, and after 7 days.
Note: Try it
Type Bayside Paint Co. in Supplier, wait a second and reload the page. The bar at the top says “You have changes you didn’t save from …”. Press “Restore”: the supplier is back. “Discard” throws the draft away.
Fields never kept in a draft
Passwords, card numbers and names that look secret are never kept in the browser. ->exceptDrafts(['driver_phone']) leaves out more fields, for example personal data.
Note: Try it
Type 4821 in Dock door code, 617-555-0199 in Driver’s phone and anything in Supplier above. Wait a second, reload and press “Restore”: only the supplier comes back, these two fields stay empty.
Someone else saved first
->conflicts() stops the save when the record was saved by someone else after the form was opened, and shows the fields that differ: keep yours and compare, load theirs, or save yours anyway. It needs a saved record, so it is on the Customers and Quotes edit pages. ->conflicts(poll: 15) also checks every 15 seconds while the form is open.
Note: Try it
Open Customers in the menu and click a customer. Open the same address in a second tab. In the second tab change Contact person and press “Save changes”. Within 15 seconds the first tab says that you saved it in another tab. Change the phone there and save: a window lists both values.
Copy from last time
->copyFromPrevious(['category', 'warehouse', 'tax_rate']) adds a “Copy from my last order” button on new records. It finds the last record of the form’s model that the signed-in user created, and lists the values before copying them.
Note: Try it
This page has no model to look in, so there is no button here. In your resource, fill the owner column when a record is created (user_id by default) and the button appears on the create page.
Enter moves to the next field
->enterToNext() is for people who type numbers on a numeric keypad all day: Enter moves to the next field and selects its value, Shift+Enter goes back. In a text area Enter still starts a new line.
Note: Try it
Click Cartons, type 12 and press Enter: the cursor moves to Pallets. Type 2, press Enter, type 340, press Enter: the cursor is in Notes. Press Enter there: a new line. Press Shift+Enter in Weight to go back to Pallets.
Required fields still empty
->requiredSummary() lists the required fields that are still empty in the bar at the top, and the list shrinks as they are filled in. Clicking a name moves to the field. After a save that fails, a second line lists the fields that need fixing.
Note: Try it
The bar at the top says “3 required fields are still empty: Warehouse · Received on · Received by”. Click “Received by” in the bar: the cursor jumps here. Type Jane Doe and the list gets shorter. Press “Show what would be saved” with the others empty: the bar lists the fields that need fixing.
Undo for the whole form
->undo() undoes the last change to the form, not only to the field with the cursor: a removed row, a chosen option, typing. Ctrl+Z (⌘Z on a Mac) undoes, Ctrl+Shift+Z (⇧⌘Z) redoes, and the bar has “Undo” and “Redo” buttons.
Note: Try it
Remove pallet P-0142 with the trash button on its row, then press “Undo” in the bar at the top of the page: the row is back. Press “Redo”: it is removed again. While the cursor is in a field, Ctrl+Z and Ctrl+Shift+Z (⌘Z and ⇧⌘Z on a Mac) do the same: type in a Pallet field and press Ctrl+Z.
Paste a row from a spreadsheet
->spreadsheetPaste() splits a row copied from Excel, Numbers or Google Sheets into the field pasted into and the ones after it. A preview shows which value goes where. Options are matched by their label, and numbers and dates are read in many forms.
Note: Try it
In a spreadsheet, put Harbor Supply Co., PO-1024, Paint & coatings, Worcester, $1,234.50 and 11/20/2026 in six cells of one row. Copy the six cells and paste them into Customer. Check the preview and press “Fill in”: all six fields are filled. “Paste as plain text” pastes the text into Customer only.
Paste several rows into a table
Rows pasted into a field of a repeater row each go into a row: the one pasted into, the rows below it, then new rows, up to ->maxItems().
Note: Try it
In a spreadsheet, make three rows of SKU, description and quantity (for example HS-1001, Exterior paint, 12). Copy them and paste into the first SKU field, then press “Fill in”: three rows are filled in.
| SKU | Description | Quantity | Actions |
|---|---|---|---|
|
|
|
|
|