Creating Data Definitions

Important

Dynamic Data Lists is deprecated as of Liferay DXP 7.3, and is planned for removal in 2024. It is replaced by Objects. Please migrate your Dynamic Data Lists to Objects as soon as possible.

To create a data definition:

  1. Navigate to Content & DataDynamic Data Lists.

  2. Click the Options icon (Options) at the top-right and click Manage Data Definitions.

    The list of existing data definitions are displayed.

    The Data Definitions screen appears. A table lists any existing data definitions. Several definitions are embedded for common use cases like contacts, events, inventory, and more.

  3. Click the Add icon (Add) to begin creating a new data definition. This opens the New Data Definition form.

  4. Give your data definition a name. Note that the definition’s name appears for any users filling out a dynamic data list that uses the definition. Expand the Details section of the form and give it a description.

    Input a name for your data definition.

    The Details section of the form also contains the field Parent Data Definition. This optional field lets you select an existing data definition (the parent) to form the basis of the new one (the child). The child definition inherits the parent’s fields and settings, which you can then customize. When you create a dynamic data list from a child definition, it includes the fields of the parent and child definitions. This lets you use a common definition (the parent) as the basis of a specialized definition (the child).

    To choose a parent definition, click the Select button below the Parent Data Definition field and then select an existing definition in the dialog that appears.

  5. Add the data definition’s fields in the data definition designer below the form’s Details section. The designer’s default View tab lets you create the definition in a WYSIWYG editor. You can click the Source tab to work with the definition’s underlying JSON, but it’s much easier to stick with the WYSIWYG editor.

    Choose the fields to associate with your data definition.

    In the View tab click the Fields tab. Icons representing the field types are listed on one side and the data definition’s canvas is on the other side. To add a field type to the definition, select its icon, drag and drop it onto the canvas. By dragging a field onto a field that’s already on the canvas, you can nest the new field in the existing field. When you mouse over a field on the canvas, the field action icons appear. Clicking the duplicate icon ( Duplicate) creates a duplicate of the current field and adds it below the current field. Clicking the trash icon ( Trash) deletes the field. See the Field Types Reference to learn more about available fields.

  6. Edit field properties to reflect their intended use. For example, a text field’s default label is Text. This can be changed to a custom value such as Email. First select the field on the canvas. This automatically selects the Settings tab on the left. Alternatively, you can access the Settings tab by clicking the field’s cog icon (Cog).

    Double-click a field label to change the default value.

    To edit a field property, double-click its value in the Settings table and enter a new value. See the Field Properties Reference to learn more.

    You can translate a data definition’s field values to any supported locales. To specify a field value for a translation, select the flag that represents the locale and enter the field value for the locale.

  7. Click Save when you’re done. Your new data definition then appears in the table.

Field Types Reference

The following field types are available when creating a Data Definition:

Field TypeDescription
BooleanA check box
ColorSpecifies a color
DateEnter a date. A valid date format is required for the date field, but you don’t have to enter a date manually. When you select the date field a mini-calendar pops up which you can use to select a date.
DecimalEnter a decimal number. The value is persisted as a double
Documents and MediaSelect a file from a Documents and Media library1
GeolocationAssociate a location with the User’s form entry.
HTMLAn area that uses a WYSIWYG editor to write and display HTML content
IntegerEnter an integer. The value is persisted as an int.
Link to PageLink to another page in the same site.
NumberEnter a decimal number or an integer. The value is persisted either as a double or an int, depending on the input’s type
RadioDisplays several clickable options. The default number of options is three but this is customizable. Only one option can be selected at a time
SelectThis is just like the radio field except that the options are hidden and must be accessed from a drop-down menu
TextEnter a single line of text
Text BoxThis is just like the text field except you can enter multiple lines of text or separate paragraphs
Web ContentSelect web content

Field Properties Reference

The following properties are available to modify. Note that some of these properties are only available for specific field types:

PropertyDescription
TypeThe field’s type (e.g., text, radio, etc.). This setting can’t be edited, but a display template can reference it
Field LabelThe field’s display name
Show LabelWhether the field label is shown
RequiredWhether users must fill out the field (not available for Boolean fields)
NameThe field’s internal identifier. You can use this value in a display template to read the field’s data. This value is automatically generated, but you can change it if you wish
Predefined ValueThe field’s default value
TipText to display in a tooltip
IndexableWhether the field is indexed for search
LocalizableWhether the field can be translated
RepeatableWhether users can make copies of the field
MultipleWhether the user can select more than one option. This is only available for Select fields
OptionsThe options available for selection in Radio and Select fields. You can add and remove options, and edit each option’s display name and value

  1. Documents added in a DDL do not inherit the permissions of the DDL. Instead, the permissions are defined by the Documents and Media configuration for the uploaded Document. This means that Documents uploaded in a tightly restricted DDL can be more accessible than the DDL records.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy