Databases enable you to develop specific lists that can cover a large number of options within a topic, such as medications, supplements or allergies. They are designed to be embedded into event and profile forms, to allow users to easily search for and select an item from a list. The database can contain hundreds of records and, with the appropriate data permissions, users can add, edit or delete options from the database. In some circumstances, these factors can make a database field a better alternative to option fields.
Database forms serve as the template for each database record (e.g. medication or supplement name). These are created and edited with the Database forms tool in the builder interface.
Building a database form
The first field in any database form will be the main search term and must be either a Single line text or Paragraph text field. This will be the name of the database record.
Each record can also contain associated information. Other fields can be added to the form and will act as additional search parameters for the database record. For example, in a database of allergies, you may include additional fields for the type and severity of the allergy. When a user interacts with the database, they can search for any of these variables (e.g. "Plant" or "Animal") to help find the right supplement record.
These secondary field values may also be pulled through to the event or profile form record. For more information, see our article on referencing a database in an event or profile form.
In addition to searching for key terms, you can also enable one of the secondary fields to be shown as a dropdown filter for the options shown. Select one field in the form and go to the field properties in the sidebar, then enable the Is a group setting.
Available field types are listed in the sidebar. Note that some field types, like history calculations, linked calculations and embedded reports are not available in database forms.
Do not insert Database fields into a database form; these should only be used in event and profile forms.
Steps to build a database form
- From the builder interface, open the Database forms tool.
- Select New database form from the Options drop-down menu.
- Name the database form.
- Select the section name (New section) and remove the title to leave it blank.
- Add a Single line text or Paragraph text field as the first field in the form.
- (Optional) Add the additional fields for the information you want to store with the database record.
- (Optional) Enable the Is a group field in the field settings for one of the secondary fields to use this field as a filter.
- Save the database form.
The database form can now be referenced within an event or profile form using a Database field. For more information, see our article on referencing a database in an event or profile form.
You will also need to populate the database with records. This can be done through the builder interface or the web version of Teamworks AMS. For more information, see our article on populating a database.
Managing database forms
To edit or view the database form, open the Database forms tool in the builder interface and select the form name.
In the Database forms tool, you can also perform the following functions:
- Change the name of a database form.
- Delete a database form, including all database records.
- Duplicate a database form.
- Bulk resave any calculations in existing database records.
- Link the database form to a child site (enterprise only).
- Copy the database form to a child site (enterprise only).
It is not possible to migrate fields or options for a database form. Changing the name of a field or its options will result in data loss in the database. Any values would need to be added by editing the database records. If the field or options are populated into manual entry-type fields in the event form (see our article on Referencing a Database), data will not be lost from those fields.
Edit a database form name
Use the Edit name function to update the name of a database form. When you change the name of a database form, this is also updated in the properties for any Database fields that reference the form.
Delete a database form
The Delete function removes the database form and all associated database records from your AMS site. We generally recommend that you don’t delete a database form unless you have checked that no other forms reference it (you can use the Data specifications tool for this) and have considered backing up your data elsewhere.
Duplicate a database form
The Duplicate function creates a copy of the database form. This doesn’t duplicate the database records. If you use the duplication function, make sure the name of your new database form is unique.
Resave a database form
You can use the Resave function to recalculate all records for a database form. You can use this when you modify or add a calculation and need to recalculate previously saved records. If you use this function, you should be aware that resaving large numbers of records might affect the performance of your AMS site until the resave is complete.
AMS will send an email to the address used by your AMS account to confirm that a resave has been finished. You should wait for the email notification to arrive before running another resave.
Link to child (enterprise only)
Use the Link to child function to link database forms created on the site to another site on the same server. This will also link all database records to the other site. To use this function, the following criteria must be met:
- The server must be configured as an enterprise instance.
- The sharing of forms from the current site to another must be enabled in the Shared sites administration tool.
- You must have a minimum of Read access to the form in your role.
Linked forms can only be edited on the site where it was created. If the form is accessed from the linked site, none of the management functions will be visible.
Copy to child (enterprise only)
Use the Copy to child function to copy database forms created on the site to another site on the same server. To use this function, the following criteria must be met:
- The server must be configured as an enterprise instance.
- The sharing of forms from the current site to another site must be enabled in the Shared sites administration tool.
- You must have a minimum of Read access to the form in your role.
Forms that are copied from one site to another can be edited in isolation - that is, changes made in one version will not be automatically applied to the other version. Database records are not copied to the other site.