A text document fragment consists of one or more paragraphs of text. A paragraph can be static or dynamic. A dynamic paragraph may contain form data model properties and variables. You can also apply rules and repeat within a text document fragment. For example, the customer name in a salutation could be a Form Data Model (FDM) property with its value made available at runtime. By changing these values, the same Interactive Communication can be used to prepare Interactive Communication for different customers using the Agent UI.
The text document fragment in Interactive Communication supports the following type of dynamic data:
Select Forms > Document Fragments.
Select Create > Text.
Specify the following information:
Title: (Optional) Enter the title for the text document fragment. Titles need not be unique and can have special characters and non-English characters. Texts are referred by their titles (when available) such as in thumbnails and properties.
Name: The unique name for the text, within a folder. No two document fragments (text, condition, or list) in any state can exist with the same name in a folder. In the Name field, you can enter only English language characters, numbers, and hyphens. The Name field is automatically populated based on the Title field. The special characters, spaces, numbers, and non-English characters entered in the Title field are replaced with hyphens in the Name field. Although the value in the Title field is automatically copied to the Name, you can edit the value.
Description: Type a description of the text.
Form Data Model: Optionally, select the Form Data Model radio button to create the text based on a form data model. When you select Form Data Model radio button, Form Data Model field appears. Browse and select a form data model. While creating text and condition for an Interactive Communication, ensure that you use the same data model that you intend to use in the Interactive Communication. For more information on Form Data Model, see Data Integration.
Tags: Optionally, to create custom tag enter value in text field and press Enter. When you save this text, the newly added tags get created.
Create Text page appears. If you have chosen to create a form data model-based text, the form data model properties appear in the left pane.
Type in the text and use the following options for formatting, conditionalizing, and inserting form data model properties and variables in your text:
You can add Form Data Model elements, Data Dictionary elements, and variables using the @ symbol in the text editor. When you enter a string preceded by @ in the text editor, all the Data Model elements, Data Dictionary elements and variables are searched and elements or variables containing the searched string are displayed. You can navigate through the search results and select an element or variable. If there is no matching result, the No matching results found message is displayed.
The text is created. Now you can proceed to using the text as a building block while creating an Interactive Communication.
You can edit an existing text document fragment using the following steps. You can also choose to edit a text document fragment from within an Interactive Communication editor.
You can personalize text document fragments by inserting the form data model properties. By inserting form data model properties in text, you can fetch and populate recipient-specific data from the associated data source while previewing an Interactive Communication. For more information on form data model, see AEM Forms Data Integration.
If you have specified a form data model while creating a text, the properties in the form data model appear in the left pane of the text editor. The specified form data model should be same for the text document fragment as well as the Interactive Communication that includes it.
Alternatively, you can search and add form data model property using the @ symbol in the text editor. Place the cursor where you want to insert the property. Type @ followed by the search string. The search operation is performed on all form data model properties and variables available in the document fragment. The properties or variables containing the search string are retrieved and displayed as a drop-down list. Navigate through the search results and click the property that you want to insert at the cursor location. Press Esc to hide the search results.
You can also use form data model properties to construct rules for displaying or hiding parts of content. For more information, see Create rules in text.
Variables are placeholders that can be bound while creating an Interactive Communication. Variables can be bound to a form data model property or text fragment. Variables can also be left for the agent to fill.
You can use variables instead of form data model properties when:
While creating or editing a text document fragment, you can create and insert variables. The variables you create appear in the Data tab of the Agent UI. The agent specifies the values for the variables while Prepare and send Interactive Communication using the Agent UI.
In the left pane, tap Variables.
The Variables pane appears.
Create Variables pane appears.
Enter the following information and tap Create:
The variable is created and listed in the Variables pane.
To insert a variable in the text, place the cursor at the appropriate place, select the variable, and tap Add Selected.
Variables are highlighted in light blue background color, while form data model properties are highlighted in a brownish color.
Alternatively, you can search and add variables using the @ symbol in the text editor. Place the cursor where you want to insert the variable. Type @ followed by the search string. The search operation is performed on all form data model properties and variables available in the document fragment. The properties and variables containing the search string are retrieved and displayed as a drop-down list. Navigate through the search results and click the variable that you want to insert at the cursor location. Press Esc to hide the search results.
Using rule editor in a text, you can create rules to display or hide strings of text or pieces of content based on preset conditions. These conditions can be constructed based on:
While creating or editing a text, select the text string, paragraph, or content that you want to conditionalize using the rule.
Tap Create Rule.
The Create Rule dialog appears. In addition to string, number, mathematical expression, and date, the following are also available in the Rule Editor for creating statements of the rules:
Select the appropriate option to be evaluated.
Collection property is not supported for creating rules to conditionalize and display text.
Select the appropriate operator to evaluate the rule, such as Is Equal To, Contains, and Starts With.
Insert the evaluating expression, value, data model property, or variable.
Rule to display the selected text if the location of the recipient is US according to the source data of FDM
The rule gets applied. The text or content to which the rule is applied is highlighted in green. When you hover over the left handle of the highlight, the applied rule appears.
On clicking the left handle of the applied rule, you get the options to edit or remove the rule.
While creating or editing text, the toolbar changes depending on the type of edits you choose to make: Paragraph, Alignment, or Listing:
Select type of toolbar: Paragraph, Alignment, or Listing
Font editing toolbar
To highlight\emphasize parts of text in an editable document fragment, select the text and tap Highlight Color.
You can either directly tap a basic color
**[A]** present in the Basic Colors palette or tap Select after using the slider
**[B]** to choose the appropriate shade of the color.
Optionally, you can also go to the Advanced tab to select the appropriate Hue, Lightness, and Saturation
**[C]** to create the precise color and then tap Select
**[D]** to apply the color to highlight the text.
To reuse one of more paragraphs of text that exist in another application, such as from Microsoft® Word or HTML pages, copy and paste the text into the text editor. The formatting of the copied text is retained in the text editor.
You can copy and paste one or more paragraphs of text in an editable text document fragment. For example, you may have an Microsoft® Word document with a bulleted list of acceptable proofs of residence such a following:
You can directly copy and paste the text from the Microsoft® Word document to an editable text document fragment. The formatting such as bulleted list, font, and text color is retained in the text document fragment.
The formatting of pasted text, however, has some limitations.
If required, insert special characters in the document fragment. For example, you can use the Special Characters palette to insert:
Text editor has built in support for 210 special characters. The admin can add support for more/custom special characters by customization.
When working with text document fragments containing a large amount of text, you need to search for a specific text string. You may also need to replace a specific string of text with an alternative string.
The Find and Replace feature allows you to search for (and replace) any string of text in a text document fragment. The feature also includes a powerful regular expression search.
Open a text document fragment for editing.
Tap Find & Replace.
Enter the text to search in the Find text box and the new text (replacement text) in the Replace text box and tap Replace.
If the searched text is found, the text is replaced by the replacement text.
You can also tap Replace all to replace all the matches in a one go.
Find & Replace also includes a powerful regular expression search. To use regex in your search, select Reg ex and then tap Find or Replace.