Compound fields are used to combine multiple fields together in a specific layout that can be reused across your functionality.
Below is an example of a compound field that is displaying a compound called Canadian Address that is using multiple string fields:
This allows you to bundle multiple fields into a single compound field for a specific purpose that can be reused across your functionality. Any field type can be used within compounds, including other compounds.
The steps below will walk you through the process of creating the example compound above:
On your functionality, navigate to the Compound Fields tab and select the Add new Compound Field Definition button on the childlist.
Specify a name for the compound, how many columns should be used to layout the fields, then select the Add new Field Definition button to begin adding fields.
Create a new field as you normally would on a form, the only difference here is you won’t be able to specify a tab. If you’re unfamiliar with creating fields, refer to the Creating Fields using trellispark UX Creator article. All field types are supported, including other compounds. Once you’ve created your fields you can move on to the next step.
Once you’ve finished creating your compound, it’s time to use it. On your functionality, navigate to the Forms tab and select the Add new Form Definition or select an existing form from the childlist.
Once you’re on a form definition, navigate to the Data Model tab and select the Add new Field Definition button.
Setup the field to your liking, then select the Compound field type, specify the XML Element Name, and select the Compound you created at the functionality level from the Compound Type dropdown list.
IMPORTANT NOTE: The XML Element Name you specify here will be used as a prefix on the XML Element Name for each field in the compound that is saving data. For example, if the compound contains a String field with the XML Element Name “Street” and the XML Element Name specified on the compound (screenshot below) is “Canadian”, when a value is entered and saved in the string field the element saved in the XML, on views, or lookup tables would be “CanadianStreet”.
Save the page, and clear the form cache and your compound field will new be ready to use on the form.