As you build database focused apps with Appli, you’ll soon have to decide how to handle both new record insertion and record editing. The easiest way is to use two different forms, one for each task.
A dedicated screen for creating new records is easy to create. The new form builder tool can help you craft that screen in less than five minutes. Just create a form, link it to the table you want, and use a button element to submit it. The form builder will do all that for you.
Another screen can edit the record and you can access it by having low-code on a layout populate its form.
That will solve the problem, but it might feel like duplication of work. Unless your UX needs the record insertion task to differ from the record editing task, you might use a single form to handle both cases.
The only difference between an editing form and a new record form is a property called “record ID“. If this property holds a reference to a record id then the form is being used to edit that specific record. If the property is empty, the form is being used to insert a new record. Below is an example of a low-code script from a layout that picks the selected record from a multi-record layout and edits it.
Instead of dealing with that property directly, use the “populate form data” action which will fill that property and then the form will be used for editing.
The “reset form” action will clear the property and set up the form for new record insertion.
Whatever choice — one or two forms — you make is up to you and the requirements of your application. Appli is a toolkit, it is up to you to pick the best tool for the job at hand.