Event form
Build a form that saves a gathering's name, date, local time, timezone, color, capacity, visitor setting, duration, format, activities and notes together. Scape renders the fields and Save button; your action validates the submitted values and returns the accepted state. Shared rows pair Date + Time and Capacity + Open to visitors, while Notes and Save stay in their authored order on separate lines. Saved notes share a public summary row. Each row wraps to fit the available space.
Source and downloads
Use the runnable Event form example for the complete definition, project entry point, source downloads and setup commands. Its source is shared with the developer-world example.
Why validation happens twice
eventFields describes both the displayed form and the trusted constraints used by validObjectFieldValue. The state validator checks every field and rejects unexpected keys. The editor-only save action additionally requires a date and time. This permits an initially blank form while preventing an incomplete save. Hiding fields from visitors helps presentation; the action permission enforces who may edit.
Capacity and duration arrive as numbers, the visitor setting as a boolean, and activities as an array of strings. Format uses a native radio group. Other values arrive as strings. The color palette suggests three colors but leaves the full picker available. Multiline notes use an explicit Save button, so changing one field does not submit a partially edited form.
Calendar values stay explicit
The definition stores the date, time and timezone separately. It does not turn them into a timestamp, schedule a notification or resolve daylight-saving changes. If you add scheduling, define how your action handles nonexistent or repeated local times before converting these values.
Try changes and invalid values
- Change capacity and the visitor setting, then save; check that their saved types remain number and boolean.
- Drag Duration (15–180 minutes in 15-minute steps), choose a Format, and select any Activities; save and reopen to check the values.
- Submit duplicate or unknown activities, an unknown format or an off-step duration; validation should reject them.
- Leave date or time empty; the action should reject the save with a useful message.
- Submit a capacity outside 1–100 or a fractional value; validation should reject it.
- Pick a color outside the suggested palette; any valid lowercase six-digit hex color is accepted.
- Enter notes with line breaks, then save and reopen Configure.
- Try the save action as a visitor; editor permission must still be enforced.
Keep the combined action payload within the payload limit. For independent controls that save on change, see automatic saving.
