Adding Elements to DataParts
4 minutes to readNormally, DataPart elements correspond to data source fields selected when configuring a DataPart. However, in some DataParts, you have the option to add elements that are not directly related to fields in tables. These elements are:
To add these elements to DataParts where they are supported, perform the following actions:
- With the DataPart open, in the right panel, click the Change data source and fields button.
- Click Next to proceed to the “Configure fields” screen.
- In the left Elements panel, click Add and select the element type you want to add.
HTML block
HTML blocks allow you to add customizable content to an AppPage. For example, you can enter description texts, insert links or graphics, and more.
HTML blocks are supported in Forms as well as Tabular and Card Reports.
You can configure the following options for HTML blocks:
General tab:
- Label – Name for a field. If you enter the label, it will appear on the left of the form.
- HTML editor:
- You can insert parameters to pass value dynamically, for instance, to display the name of a logged in user. If the inserted parameter is of the Text data type or a formula field that returns text, you can apply HTML formatting to dynamically render rich content such as headings, styled text, or embedded HTML.
- You can insert and format your text using the rich text editor or insert code in the Code mode.
Appearance tab:
- Field size – field width. Select between:
- Auto – adjusts the width of a field to its content,
- Fixed – sets the precise size of a field width in pixels. The content of a field will not be visible if it exceeds the set size.
- Label position – choose between Left, Top, or No label.
- Next element position – choose between Below or Inline.
Scripts in HTML blocks
Scripts allow HTML blocks to support advanced features like JavaScript, giving you more flexibility to customize your app. However, if your HTML content includes anything submitted by users, there’s a potential security risk. Malicious user input could exploit features like JavaScript to compromise the safety of your users.
In HTML blocks in Flex, scripts are disabled by default. This way, content is sanitized, keeping it safe from any executable codes. However, if you fully control the content of the HTML block and no user-supplied data is involved, you can choose to enable scripts. To do so, at the bottom of an HTML block configuration window, clear the checkbox next to Enable safer content display by blocking script-based content.
Virtual field
The Virtual Field form element allows you to create temporary fields which do not correspond to table fields. They are supported in Forms, where they serve as flexible, user-defined parameters. For example:
- In Search Forms, you can use virtual fields as filtering criteria for other DataParts, such as Reports, Details/Update Forms, or Charts.
- In other Form DataParts, you can use virtual fields for real-time calculations.
Note: If a virtual field is used in a calculated value, it cannot be removed until its reference is removed from the calculation. This helps maintain the integrity of calculated values.
For Virtual fields, configure the following options:
- Field name: Enter the name for the virtual field. Virtual field names require the underscore character (“_”) as a prefix.
- Form element: Select the element type for the virtual field.
The available element types are: Text field, Text area, Calculated value, Radio buttons, Checkbox, Dropdown, Listbox, Hidden, and AutoComplete.
Other settings depend on the selected form element type.
Section
You can add sections to DataParts to visually or logically separate parts of the DataPart. Sections are supported in Forms.
For each section, you can enter a heading and description to guide your users. In the Appearance tab, you can modify the number of columns that the section displays.