Creating a subform
A subform is a form within a form.
This documentation is a work in progess. Subforms are currently in preview-release.
Subforms are contained in a subform table. Let us go through configuring a subform table and the subform contained within.
- Create a data model for the subform.
- You should now see the three files under
App/model
. The c# class, the json schema and the xsd. - Set appLogic.allowInSubform to true in applicationMetadata.json.
- Create a folder under App/ui with your desired subform name.
- In the subform folder, add a
Settings.json
file and a folder called layouts. - You can add page layouts to the layouts folder as you would for the main form.Subforms do not support attachments, and nesting subforms is not allowed.
- The Settings.json file for the sub form is configured as normal.
- Add a layout set to
layout-sets.json
with the data type of the data model from step 1. The type is subform. Choose your subform folder name as the id.{ "id": "desired-subform-name", "dataType": "your-subform-dataType", "type": "subform" },
- Navigate to the layout for the page in the main form in which you want to add the sub form table.
- Add
Subform
with the configuration you want. Example:{ "id": "subform-mopeder", "type": "Subform", "textResourceBindings": { "title": "subform-moped.title", "addButton": "subform-moped.add" }, "layoutSet": "moped-subform", "showAddButton": true, "showDeleteButton": true, "tableColumns": [ { "headerContent": "subform-moped.regno", "cellContent": { "query": "RegNo" } }, { "headerContent": "subform-moped.merke", "cellContent": { "query": "Merke" } }, { "headerContent": "Ekstra info", "cellContent": { "query": "EkstraInfoData", "default": "moped-extrainfo.value.default" } } ] },
Subforms can have their own summary page and be a part of the main forms summary. To add a subform into the main forms summary, use the subform id from the main forms layout, and the type "component".- Configuration options for subform layout
Options for subform layout configuration
- Configuration options for subform layout