Add a table of related records to a form
Before you start
A Table puts a small grid of related records on a form. A purchase order carries its order lines. A leave request carries the days off. People add rows, change them and see totals, and the rows are saved with the record. This page builds one.
Add the Table
Section titled “Add the Table”- In the Form builder, open the Components tab on the left.
- Drag Table into a block. A card appears with the note “No columns yet. Open settings to bind the table to a module.”
- Click the cog icon on the card. The Table settings dialog opens.
- Click the name at the top and type a table name, for example
order_lines.
The table name is used by other components to refer to this table. Use letters, numbers and underscores. Name every table. A name makes the setup easier to read.
Set up the table
Section titled “Set up the table”The setup strip at the top has three rows.
Rows are saved in. Pick the module that stores the rows, for example Purchase Order Lines. Switch on Save rows so the rows are stored in the module. Then choose the field that links the lines to this form’s module.
Rows are added by. Click Add a way. The menu offers the buttons on this form and the other tables, plus two extras:
| Way | What it does |
|---|---|
| Picks records | A Button with the action Get Data opens a list. The records people tick become rows |
| Adds a row | A Button with the action Data Entry adds an empty row |
| Copies rows | Takes the rows of another table on the form |
| Reloads when it changes | Reloads this table when another table changes |
| Scans a barcode | A Button with the action Barcode Scanner fills the table from a scan |
| Other signal… | Type a signal name yourself |
| One row per lookup option | Adds a row for each option of a lookup field, filled in on new records. Needs a module first |
A button shows in the menu only when it has a Click Event Name. If it has none, the menu says “Give this button an event name first”. See Add a button to a form.
People can has one switch, remove rows.
Choose the columns
Section titled “Choose the columns”On the Columns tab, columns are grouped as Shown on the form and Hidden. Hidden columns are filled in but not shown. Drag a column to reorder it.
- Click Field from the module to add a column for a field of the saved module.
- Click Calculated column to add a column that comes from a Smart Script.
Open a column to set its Header and its Field, then Value comes from:
| Option | Use it when |
|---|---|
| Typed by people | People enter the value |
| Filled when rows come in | The value comes from the record that was picked |
| Calculated | A Smart Script works the value out |
For a calculated column, Work it out offers When the row is added or On every change. “On every change” replaces anything people type, so use “When the row is added” if they should be able to override it.
Under Editing, switch on People can change this value and choose Edit with: Number box, Text box, Date picker, Dropdown, Yes / No, Record picker, File or Files.
Add totals and rules
Section titled “Add totals and rules”The Totals tab shows the Sum row under the columns, which you turn on per column, and Lines below the table, where Add line adds a total line that can also be saved in a field of the record.
The Rules tab holds the table’s behaviour:
- Skip records already in the table stops the same record being picked twice.
- Order of saved rows sorts the rows when the record is opened again, by a field, from A to Z or the reverse.
- Only show some saved rows hides rows that don’t match your conditions. They are hidden, not deleted.
- Rows per page sets how many rows show before paging.
- Check each row before saving takes two Smart Scripts. Row is valid when must evaluate to true, and Message is what people read when a row fails. Rows that fail show your message so people can fix them.
Click Done. The note at the bottom says “Changes apply to the form when you save it.” Then click Save on the form.
What should I know before I start?
Section titled “What should I know before I start?”- Save rows must be on for the rows to reach the module.
- A Button needs a Click Event Name before the table can listen to it.
- Complete the settings you switch on. With filtering on, choose a field and an operator. With a custom sort column, choose the sort type.
Check yourself
What's next
Last checked