1. How an app fits together
App Studio is the no-code builder inside the note editor: you add your tables or saved queries, place blocks on pages, link them, and publish. The published app opens in its own window for anyone allowed to open the project, and each person sees only the data their role allows.
The four parts of an app
| Part | What it is |
|---|---|
| Data source | A table from one of your databases, a saved query from the query builder, or (admins only) a SQLite store. Blocks read and write through sources. |
| Page | A tab across the top of the running app. Every app has at least one. |
| Block | One piece of a page (table, list, form, chart, clock…) placed on a 12-column grid. There are 21 block types. |
| Pop-up form | A form that opens in a window when a row button, a pick or a Button block triggers it. |
Picks and links: how blocks talk to each other
This is the one idea to understand before building. Selectors are blocks where the user picks a record: Table, Cards, Board, Calendar, Timeline, Gallery, List and Dropdown. Any other block can be linked to a selector and then follows whatever is picked.
| Link kind | Used by | You set | Effect |
|---|---|---|---|
| Filter link | Table, Cards, Board, List, Dropdown, Calendar, Number, Chart, Timer, Add forms | Their column → my column | Shows only rows where my column equals the picked record's column. Example: Customers id → Orders customer_id. |
| Record link | Detail, Text, Image, Edit forms | Just the selector | Shows or edits the picked record itself. |
- Until something is picked, a linked block shows Select a record in ….
- Links chain (Dropdown → List → Table); changing an upper pick clears the picks below it. Linking two dropdowns gives cascading dropdowns (country → city).
- Links can cross pages: an Open a page action passes the picked record, which the new page reads as
{{page.column}}. - A Filter bar is a third way to narrow blocks, using the user's search text, choice, date range or yes/no.
Record blocks: picked record or first match
Detail, Text, Image and Edit forms show one record. If linked, they show the picked record. If not linked but given their own data and filters, they show the first matching row. That is how you build a "my profile" page: data = users table, filter user_uid equals {{me}}.
New records fill themselves in
When any block adds a record, it automatically fills every equals filter on the block, the link value, and (for pop-ups) the Fill from pair. A list filtered to done = 0 and owner = {{me}} therefore adds items that are not done and belong to you, with no extra setup.
Tokens
Tokens work in filter values, field defaults, "Set a field" values, rules, after-save steps and text.
| Token | Becomes |
|---|---|
{{me}} | The signed-in user's key |
{{today}} / {{now}} | Today's date / the current date and time |
{{app}} | The app's name |
{{user.column}} | A column of the signed-in user's record (needs Signed-in user set up, section 5) |
{{page.column}} | A value the page was opened with (a picked record or a deep link) |
{{column}} | A field of the current record, in text, captions, pop-up titles, row-action labels |
The key column and security
Each source needs a Key column (its primary key) to edit, delete, tick, drag on a board, link and log time. The Studio guesses it; a source with no key, or marked Read-only, hides all changing actions.
The Studio never bypasses the engine. Reads use fetchData, writes use insertMultiple / updateMultiple / deleteMultiple, and filter values are always sent as bound parameters. Role, table and sharing permissions apply exactly as elsewhere in SepoDesk. Show when rules only change what is shown; the server still decides what each user may read and change.
2. Before you start
You need an existing project in the note editor, the tables the app will use, and a user account allowed to read them. Admins and regular users can both build apps; each builder only sees the data their role allows.
- [ ] Tables exist. App Studio uses existing tables and never creates them. Build them first in the schema builder.
- [ ] Each table you edit has a primary key. Without one, edit, delete, tick, board drag and links are hidden.
- [ ] Saved queries (optional) are made in the legacy query builder. Query sources can be read, updated and deleted, but not added to.
- [ ] A users table (optional) if the app should know the signed-in user's name, role or department.
- [ ] The deployed files match.
sp-app-runtime.jsandsp-app-studio.jsmust be replaced together; both carryKIT_VERSION(currently2026.10.3). A mismatch shows a message naming both versions.
Where to find App Studio
Open the note editor → Projects list → click App Studio on the project's row. It opens inside the note editor, not as a separate shell app.
The Studio screen
| Area | What it holds |
|---|---|
| Top bar | App name (click to rename) · save state · ⚠ N to check · Undo / Redo · Design / Preview with desktop ▭ and phone ▯ widths · Templates · ⟲ Versions · \</> JSON · Save draft · Publish |
| Left panel | Data (+ Table, + Query), Pop-up forms (+ Pop-up), Blocks palette with a Find a block… box. Sections fold and the Studio remembers which. |
| Centre | Page tabs with + Page, and the canvas: a 12-column grid of block tiles, or the live Preview. |
| Right panel | Settings of whatever is selected: a block, a pop-up, or (nothing selected) the Page, App, Look and Signed-in user settings plus the To check list. |
Useful shortcuts: Ctrl+Z / Ctrl+Y undo and redo (up to 60 steps). With a tile focused, Delete removes it and Alt+← / → moves it. Drag tiles to reorder them or move them into and out of Tabs blocks.
3. Build your first app, step by step
This walkthrough builds Customers & Orders in nine steps: pick a customer from a list, see their details, their orders and a total, and add orders through a pop-up. It needs two tables:
customers(idkey,name,city,status)orders(order_idkey,customer_id,amount,paid,created_at)
- Open the Studio. Note editor → Projects → App Studio on your project. Click the app name in the top bar and rename it Customers & Orders.
- Add the data. Data → + Table → choose the database → click customers. Repeat for orders. Click each source and check the Key column (
id,order_id); fix it if the guess is wrong. - Add a list to pick customers. Click List in the palette. In the right panel set:
- Width: ⅓
- List: Main text
name, Second linecity, Badgestatus - Toolbar: tick New button
- Show the picked customer. With the list selected, click Detail; it links to the list automatically. Set Width ⅓ and Fields shown
name,city,status. - Show the customer's orders. Click Table and set Block → Data to Orders. Then:
- Link: Only rows matching the record picked in Customers, their column
id= my columncustomer_id - Columns:
amount(Currency),paid(Yes / No),created_at(Date & time) - Sort:
created_at, newest first - Row actions: Edit in a form and Delete
- Add a total. Click Number: Data Orders, Calculate Sum of
amount, PrefixK. Link it to the Customers list the same way (id→customer_id). - Add a pop-up for new orders. Pop-up forms → + Pop-up, then:
- Title
New order for {{name}}, Data Orders, Mode Add a record, Button text Add order - Fill from the clicked record: its column
id→ my columncustomer_id - Form fields:
amount(Required),paid,created_at - Select the Customers list → Row actions → + Action → Open a pop-up form → choose the pop-up, label Add order
- Try it in Preview. Pick a customer: the detail, orders and total follow. Hover the customer, click Add order, save, and the table and total update.
- Publish. Press Publish (this also sets Run as → App Studio app). Close the Studio and launch the app with the project's Command ID (from Copy cmd).
Faster: Templates → Records & sub-records builds steps 3–6 for you. Choose customers as the main table and orders as the related table, then add the pop-up from step 7.
4. Reference
Every block, setting and action in App Studio, grouped as they appear in the palette and the right panel.
Data sources
- + Table: pick a database, filter, click a table. If listing is not allowed for you, type the table name and press Enter.
- + Query: pick a saved query from the query builder.
- SQLite stores (admins only) appear at the end of the database list; see SQLite sources below.
- Source settings: Name, Key column, UID column (filled by the server on new records), Max rows (default 500, maximum 5000), Read-only, the column list, Reload columns, Remove.
Blocks in the palette
| Group | Blocks |
|---|---|
| Data | Table, Cards, Board, Calendar, Detail, Form, Timeline, Gallery |
| Pickers | List, Dropdown, Filter bar |
| Numbers & charts | Number, Chart, Timer, Progress |
| Layout & content | Tabs, Text, Image, Clock, Button, Rich text |
Click a block to add it after the selected one (or into the open tab of a selected Tabs block), or drag it exactly where you want it. Width can be ¼, ⅓, ½, ⅔, ¾ or Full; blocks wrap when a row is full and become full width on narrow windows.
Settings shared by many blocks
| Section | Appears on | What it does |
|---|---|---|
| Block | All | Title, Type (switching keeps compatible settings), Data, Width, Title bar, Card background |
| Show when | All | Shows the block only when its rules hold; Hide on small screens hides it on phones |
| Colour rules | Table, Cards, Board, List, Calendar, Timeline, Gallery | Column + condition + value → Green, Red, Amber, Blue, Purple, Faded, Bold or Struck through, for the row or one column |
| Link | All except Tabs, Clock, Button | Filter link or record link (section 1) |
| Columns / Fields | Table, Cards, Board, Detail, Form | Choose, order and label fields; format as Auto, Text, Number, Currency, Percent, Date, Date & time, Yes/No, Badge, Link or Picture |
| Sort | Table, Cards, Board, List, Timeline, Gallery | Default order; users can still click table headers |
| Filters | Data blocks, record blocks with own data, Add forms | Column + condition + value; all must match; equals values also fill new records |
| Toolbar | Selector blocks (Print also on Detail, Number, Chart, Progress, Rich text) | Search, New, Import CSV, Export CSV, Print, Reload, rows per page; needs Title bar on |
| Row actions | Selector blocks | Edit in a form · Delete · Set a field · Open a page · Open a pop-up form · Print the record; Show only when… hides the button per row |
| When an item is picked | Selectors | Nothing else, Open a pop-up form, or Open a page |
| After saving | Forms, pop-ups, blocks with New / Edit | Steps run after a save (below) |
Conditions available everywhere: equals, not equal, >, ≥, <, ≤, contains, starts with, is empty, is not empty, is yes, is no.
Data and picker blocks
| Block | Key settings | Behaviour |
|---|---|---|
| Table | Columns, Sort, Rows per page, Bulk & quick edit, Groups & totals | Click a row to pick it. Bulk adds tick boxes with Delete and Set-a-field buttons. Double-click a cell to quick-edit (Enter saves, Esc cancels). Groups fold under headings with counts, subtotals and a Total row. |
| Cards | Card title, Subtitle, Badge | Up to 4 extra fields per card |
| Board | Lanes from, Lane order | Drag a card to another lane to change that column (needs a key) |
| Calendar | Date, End date, Event title, Colour by, Double-click adds | Month view, Monday first; double-click a day to add an event on that date |
| List | Main text, Second line, Badge, Tick box, Quick add, Height | Access-style list box; tick saves 1 / 0; quick add is type + Enter |
| Dropdown | Show column, Placeholder, Pick first automatically | Picks one record; waits for its own link if it has one |
| Detail | Fields shown | Picked record, or first match of its own data and filters |
| Form | Mode (Add / Edit), Button text, field options, Sub-form, After saving | Add clears after saving; Edit shows the picked record or first match |
| Timeline | Date, Title, Text, Badge | Activity feed grouped by day, newest first |
| Gallery | Picture column, Caption, Tile size | Picture tiles from links; double-click to enlarge |
| Filter bar | Blocks it filters, filters | Search text, Choice, Date range, Number range, Yes / No; Clear resets |
Numbers, charts and content blocks
| Block | Key settings |
|---|---|
| Number | Count, sum, average, minimum or maximum of a column; prefix, suffix, format |
| Chart | Bars, Line (over time), Pie or Donut; Group by; Dates by day / week / month / year; Show top N |
| Progress | A value against a Goal (a number, a token, or the sum of a goal column), as Bar or Ring |
| Timer | A time-log table with Start, End, Minutes and Note; Stop saves one row; survives a reload |
| Tabs | Holds any blocks, including more Tabs; only the open tab loads its data |
| Text | Text with tokens; styles Big heading, Heading, Text, Small muted, Callout |
| Image | Picture link or picture column; Height, Shape, Fit, Caption |
| Clock | 12-hour, Seconds, Date, Size, Time zone (e.g. Africa/Lusaka) |
| Button | Open a page, open a pop-up form (with Record from a selector), or open a link |
| Rich text | Markdown with tokens; never runs HTML |
Numbers and charts work on the loaded rows (up to the source's Max rows) after filters and links.
Pop-up forms
| Setting | Meaning |
|---|---|
| Title | Can use the clicked record, e.g. Edit {{name}} |
| Data, Mode | Add a record or Edit a record |
| Button text, Width | Save button label; dialog width 320–1200 px |
| Fill from the clicked record | Its column → my column. Add copies the value in; Edit finds the record where my column equals it |
| Form fields, Filters, Sub-form, After saving | As for Form blocks |
| Opened from / Try it | Lists everything that opens this pop-up; opens it right away for testing |
Open a pop-up from a row action, When an item is picked, or a Button. Deleting a pop-up removes the actions that open it.
Form field options (▸ More options)
| Setting | Meaning |
|---|---|
| Input | Automatic, Text, Long text, Number, Date, Date & time, Time, Yes / No switch, Choice list, Email, Phone, Link, Colour, Picture link (URL) |
| Choices | For a choice list: low, normal, high or low=Low, high=High! |
| Default | A value or token for new records; filters and links still win |
| Placeholder, Help text | Hint inside the box; small text under it |
| Min, Max, Pattern | Checked before saving (pattern = regular expression) |
| Show names from | A lookup: shows Acme instead of 1 and turns the form field into a dropdown of names; the key is saved |
| Show when | Shows the field only when its rules hold, e.g. Reason only when status equals rejected; hidden fields are not saved |
Pictures are always links (https://… or /uploads/…); App Studio has no file uploads.
After saving
| Step | Does |
|---|---|
| Show a message | e.g. Order {{order_id}} saved |
| Open a page | With the saved record as {{page.column}} |
| Add a record to… | Another table, e.g. an activity log (who = {{me}}) |
| Reload a block | e.g. a total on another tab |
Steps run in the browser after the save succeeds. There are no emails or notifications after saving.
Sub-forms (lines inside a record)
On a form or pop-up, Sub-form → Lines from a second table (e.g. order lines in an order form). Set this record's key, the lines' column that points to it, a heading and the line columns.
- In Add mode the record saves first, then its lines with the new key.
- In Edit mode existing lines load; changed lines update, removed ones delete, new ones add.
- Blank new lines are ignored. If lines fail after the record saved, you get a warning and the record stays.
Templates
Templates → pick one → choose your tables → check the guessed columns → Create pages. Templates reuse existing sources and never create tables.
| Template | Tables | Builds |
|---|---|---|
| To-do list | tasks | Heading, clock, To do / Done counts, priority donut, To do and Done tabs, edit form |
| Calendar | events | Calendar, event detail, upcoming list, new-event form |
| Dashboard | any table | Count, total, average, largest, pie, bars, latest records |
| Profile | users | Photo, name, About and Edit profile tabs, filtered by {{me}} |
| Time manager | tasks + time log | Task list, timer, minutes per task, log table, report page |
| Records & sub-records | main + related table | Main list, related table and count, details and edit tabs |
Import, export and print
- Import CSV (Table, Cards, List): comma or semicolon files up to 5000 rows and 8 MB. Match file columns to table columns, then Import; rows go in batches of 100 and the block's filters and link fill each row.
- Export CSV: the rows after search and sort.
- Print: prints the block as a clean table or record; Print the record prints one row. Use the browser's dialog to save as PDF.
SQLite sources
SQLite stores are the .sqlite files in Storage/Database. Only system root and administrators can use them, so build SQLite apps for admin users and use MySQL tables for everyone else.
- Reads, filters and links work as on MySQL tables.
- Writes need
SQL_EDITOR_SQLITE_WRITE(on by default), a writable file and folder, and the user's create / update / delete right. - A table without a primary key uses
rowid.createdandupdatedcolumns are stamped automatically. - StoreDbTrait mirrors are rewritten from MySQL, so change the MySQL table instead.
5. Look, theme and the signed-in user
Apps follow the desktop theme automatically, in light and dark mode; set an accent colour only when an app needs its own brand colour. Click empty canvas to see these settings in the right panel.
Look
- Accent colour: a
#rrggbbcolour for the app's buttons, highlights and charts. Leave it empty to use the theme's button colour. - Icon and Show app name on top for the app header.
- App: currency code and default rows per page.
The runtime styles every block from AppShell tokens: surface and layer backgrounds, --text-primary / --text-muted, --window-border, input tokens, --selection-bg for picked rows, and --danger / --success for messages. Switching the desktop theme or dark mode restyles a running app with no change to its definition.
Block appearance
- Title bar shows the title and toolbar. Text, Image, Clock, Button and Dropdown have it off by default.
- Card background draws the bordered card. Text and Button are plain by default.
- In Preview, ▯ switches to phone width; blocks marked Hide on small screens disappear there.
Signed-in user and roles
Set Signed-in user to the source that holds user details (a users table or saved query) and the column that holds the user key. The app loads that one record at start, then:
{{user.column}}works in text, defaults and filters;- rules can check the user, e.g. Show when Signed-in user's
roleequalsadmin.
Rules use one shape everywhere: what to look at → condition → value. You can look at the record picked in a block, the signed-in user, a page value, or this record / this form.
| Goal | Rule |
|---|---|
| Order details only after an order is picked | Record picked in Orders · (any column) · is picked |
| A block for admins only | Signed-in user's role equals admin |
| Approve only on pending rows | This record's status equals pending (on the row action) |
| Reason field only when rejecting | This form's status equals rejected (on the field) |
Hidden blocks do not load until they show. Rules shape the screen only; a user who lacks a permission is still stopped by the server.
6. Test, save, publish and run
Use Save draft while you work and Publish when users should get the new version; users always run the last published version.
Drafts, publishing and versions
| Action | What happens |
|---|---|
| Save draft | Writes studioDraft only. Users keep the published app; the Studio reopens the draft next time. |
| Publish | Writes studio, sets version: 2, removes the draft and keeps the five previous published versions in studioHistory. Also sets Run as → App Studio app. |
| ⟲ Versions | Restore an earlier version into the editor (then publish it), or Discard draft to go back to what is live. |
| \</> JSON | View, copy or paste the whole definition; Apply replaces the app with what you pasted. |
Everything is stored in the project's sp_app_project_config column; your existing App Configuration keys are kept alongside it.
Testing in Preview
Preview runs the app inside the Studio with real data, and you can keep editing in the right panel while it runs. Switch to ▯ phone width to check small screens. If ordinary users will use the app, also test with a non-admin account, since Preview uses your own permissions.
Running the published app
- Launch it like any legacy app, through the project's Command ID (
CoreBootAppwith theprojectUID). CoreBootAppruns the Studio app whenversionis 2 andstudioexists; otherwise it runs the legacy list app. App Config → Run as switches between the two at any time (the App Studio option appears after the first publish).- Window size comes from App Config → Window → Width / Height (default 1188 × 640).
- Deep links open a given page with a value:
new CoreBootApp(shell, ctx, { appID, projectUID, page: "Orders", params: { id: 7 } })gives that page{{page.id}} = 7.
Checklist before you publish
- [ ] Every data block has Data.
- [ ] Sources that are edited have a Key column and are not Read-only.
- [ ] Filter links have both columns set.
- [ ] Calendars have a date column, boards a lane column, charts a group column, timers a start or minutes column.
- [ ] Buttons, row actions and on-pick actions point to an existing page or pop-up.
- [ ] Filter bars target at least one block; rules that check the user have Signed-in user set up.
- [ ] Sub-forms have the column their lines point to.
- [ ] Preview works with a normal (non-admin) account.
- [ ] The ⚠ to check badge is gone, or you know why each item is fine.
7. Troubleshooting
Most problems come from a missing key column, a half-set link, or a draft that was never published.
| Symptom | Likely cause and fix |
|---|---|
| Pick a data source for this block | Set Data on the block. |
| Select a record in "…" never goes away | Nothing is picked yet, or the link's columns are wrong; check Their column and my column. |
| Edit / Delete buttons are missing | The source has no Key column, or is Read-only. |
| New records can only be added to table sources | Saved queries can't add records; use a table source. |
| A source shows no columns | Click Reload columns; check the table name and your access. |
| An error message under a block | The server refused, usually a permission. Same rules as the rest of SepoDesk. |
| Numbers or charts look too small | Only the first Max rows load; raise it on the source (maximum 5000). |
| The app still opens the old list | App Config → Run as → App Studio app, then save. |
| Users still see the old version | You saved a draft; press Publish. |
| A block never shows | Its Show when rules fail; check the picked block, column and user source. |
{{user.x}} is empty | Signed-in user is not set, or its key column doesn't match the user key. |
| A lookup shows the number, not the name | In Show names from, the match column must hold the same values as the field. |
| Sub-form lines don't save on a new record | The new record's key couldn't be found; give the table a key the server returns, or make saved values unique enough to read back. |
| A filter-bar filter does nothing on a block | That block's data has no such column. |
| The SQL editor is available to administrators only | The block uses a SQLite source; only admins can load SQLite stores. |
| A SQLite source is read-only | The file or folder isn't writable, or SQL_EDITOR_SQLITE_WRITE=false. |
| The Studio shows a version message on open | sp-app-runtime.js and sp-app-studio.js are different versions; replace both and clear the browser cache. |
8. Developer notes
For extending App Studio itself. All files live in core/ and declare only classes at top level, so they are safe for the core bundle.
| File | Class | Role |
|---|---|---|
sp-app-runtime.js | AppStudioKit, AppStudioDataClient, AppStudioRuntime | Helpers, block types and CSS; all server calls; renders and runs an app |
sp-app-studio.js | AppStudio | The builder: templates, pop-up editor, undo / redo, drafts, versions |
sp-core-boot-app.js | CoreBootApp | Runs version 2 apps (with optional deep link), otherwise the legacy list |
sp-app-editor.js | AppConfigEditor | Legacy App Configuration; keeps studio; Run as |
sp-note-editor.js | NoteEditor | Adds the App Studio button and _openAppStudio() |
Adding a block type
- Add it to
AppStudioKit.BLOCK_TYPES(label,icon,span,group, plusdata/selector/recordflags) and its icon path toAppStudioKit.P. - Add its settings and defaults in
AppStudioKit.normalizeBlock. - Render it in
AppStudioRuntime.refreshBlock(non-data) or_paint(data), with CSS inRUNTIME_CSSusing the--ar-*theme variables. - In
AppStudio, add its inspector section (_blockInspector), tile summary (_tileLines), defaults (addBlock), checks (issues()) and reference cleanup (_dropRefs()). - If its rows can be coloured, add it to
AppStudioKit.STYLED_TYPESand call_rowStyle(b, row)where rows are drawn.
When the definition shape changes, bump KIT_VERSION in both sp-app-runtime.js and sp-app-studio.js and deploy them together. Always pass a definition through AppStudioKit.normalizeDefinition() before use.
Known limits
- Sorting, search, paging, groups, numbers and charts work on the loaded rows (up to Max rows); grouped tables show up to 2000 rows.
- For saved queries only equals filters go to the server; is yes / is no always filter the loaded rows.
- Show when, row-action rules and after-save steps run in the browser; they are not security.
- No file uploads, emails or notifications; templates don't create tables.