Vaatate praegu abisisu järgmise versiooni jaoks::

Using inline conditions and repeat in letters, you can create your letters highly contextual and well structured.

Inline conditions

Correspondence Management allows you to use inline conditions in text modules to automate rendering of text that depends on the context or data associated with the data dictionary. Inline condition displays specific content based on condition evaluation being true or false.

Conditions perform computations on data values provided by the Data Dictionary or by end users. Using inline conditions, you can save time and reduce human errors, while creating highly contextual and personalized letters. 

Example: Using inline condition in a letter to render the appropriate address

You can insert inline condition in a letter by inserting the inline condition in the appropriate text module. The following example uses two conditions to evaluate and display the appropriate address, Sir or Ma'am, in a letter based on the DD element Gender. Using similar steps, you can create other conditions. 

Märkus.

If your existing assets include old condition/repeat expressions (pre 6.2 SP1 CFP 4), the assets display old syntax of condition and repeat. However, the old condition/repeat works. Also, the new and old condition/repeat expressions are compatible with each other to create a nested mix of old and new condition/repeat expressions.

  1. In the relevant text module, select the part of text that you want to conditionalize and tap Condition

    1_SelectText

    The Condition dialog appears with an empty condition.

    2_ConditionDialog

    Märkus.

    Empty or invalid conditional expression cannot be saved. There has to be a valid conditional expression inside ${} to save the expression. 

  2. Do the following to construct a condition for evaluating whether the selected/conditionalized text appears in the letter and then tap the check mark to save the expression:

    Double-tap a DD element to insert it in the condition. Insert the appropriate operator and construct the following condition in dialog.

    ${DD_creditcard_Gender=="Male"}
    

    For more information on creating the expression, see Creating expressions and remote functions with expression builder in Expression Builder. The value specified in the expression must be supported for the element in the data dictionary. For more information, see Data Dictionary.

    Once the condition is inserted, you can hover over the handle on the left of the condition to view the condition. You can tap the handle to view the pop-up menu of the condition, which allows you to edit or remove the condition.

    3_HoverHandle
    4_EditConditionRemoveConditionPopup
  3. Insert similar condition by selecting the text Ma'am.

    ${DD_creditcard_Gender == "Female"}
  4. Preview the relevant letter and notice that the text is rendered according to the inline condition. You can input the value of DD element Gender using:

    • A sample XML data file created based on the relevant data dictionary while previewing the letter with sample data.
    • An XML data file attached to the relevant data dictionary. 

    For more information, see Data Dictionary.

    5_LetterOutput

Repeat

You may have dynamic information in your letter, such as transactions in a credit card statement, the instance or occurrence of which may keep changing with each generated letter. Using repeat, you can format and structure such dynamic information. 

Further, you can specify condition within the repeat construct to conditionalize the information/entries that are rendered in the letter.

Example: Using repeat in a letter to format, structure, and display a list of credit card transactions

The following example gives you the steps for using repeat to structure and render the credit card transactions in a letter. Using similar steps, you can use repeat in a different scenario. 

  1. Open (while editing or creating) a text module that has DD elements that render repeated/dynamic data and embed the required text around the DD elements. For example, a text module has the following DD elements to create a statement of transactions on a credit card:

     

    {^DD_creditcard_TransactionDate^} {^DD_creditcard_TransactionAmount^}
    {^DD_creditcard_TransactionType^} 

    These DD elements render a list of the transactions made on the credit card with the following information:

    Transaction date, Transaction amount, and Transaction type (Debit or Credit)

  2. Embed the text within the DD elements to make the statement more readable, such as following:

    1_repeat
    
    Date: {^DD_creditcard_TransactionDate^} Amount (USD): {^DD_creditcard_TransactionAmount^} Transaction Type: {^DD_creditcard_TransactionType^} 
    

    The job of rendering a well formatted statement, however, is not done yet. If you render a letter based on the work done so far, it appears as the following:

    1_1RenderWithoutRepeat

    To repeat the static text along with the DD elements, you need to apply repeat as explained in the further steps.

  3. Select the static text as well as the DD elements that you want to repeat, as shown below:

    2_repeat_SelectText
  4. Tap Repeat. The Repeat dialog appears with an empty inline condition. 

    3_repeat_dialog
  5. If required, insert a condition to selectively render the transactions, such as to render transaction amounts bigger than 50 cents:

    ${DD_creditcard_TransactionAmount > 0.5}

    Otherwise, if you do not need to render the information (here transactions) selectively, keep the condition empty by deleting the following in the dialog: ${}. Saving a repeat expression gets enabled either when the repeat expression window is empty (without ${} when no repeat is needed) or when it contains a valid condition for repeat.

  6. Select a separator for formatting the dynamic text and tap the check mark to save:

    • Line Break: Inserts line break after each transaction entry in the output letter.
    • Text: Inserts the specified text character after each transaction entry in the output letter.

    Once the condition is inserted, the text with repeat is highlighted in red and a handle appears on its left. You can hover over the handle on the left of the repeat to view the repeat construct. 

    4_repeat_HoverDetail

    You can tap the handle to view the pop-up menu of the repeat, which allows you to edit or remove the repeat construct.

    5_repeatEditRemove
  7. Preview the relevant letter and notice that the text is rendered according to repeat. You can input the value of DD elements using:

    • A sample XML data file created based on the relevant data dictionary while previewing the letter with sample data.
    • An XML data file attached to the relevant data dictionary. 

    For more information, see Data Dictionary.

    6_RepeatOutputPreview

    The static text repeats with the transaction details. Repeating static text is facilitated by the repeat applied to the text in this procedure. The condition, ${DD_creditcard_TransactionAmount > 0.5}, ensures that the transactions below USD .5 are not rendered in the letter.

    Märkus.

    You can insert condition and repeat only while creating or editing the relevant text module. While previewing the letter, although you can make edits to the text module, you cannot insert condition or repeat.

Using inline condition and repeat - some use cases

Repeat within condition

You may require to use repeat within a condition. Correspondence Management allows you to use repeat within an inline condition construct. 

For example, following is repeat (formatted in red) within a condition (formatted in green).

While the repeat renders the credit card transactions, the condition ${DD_creditcard_nooftransactions > 0} ensures that the repeat construct is rendered only if there's at least one transaction. 

RepeatWitinCondition

Similarly, according to your requirement, you can create:

  • One or more conditions within a condition
  • One or more conditions within a repeat
  • A combination of conditions and repeat within a condition or repeat

Empty inline condition

You may need to insert empty inline conditions and embed text and DD elements later. Correspondence Management allows you to do that.

EmptyCondition

It is, however, recommended that if possible, you insert the text and DD elements first in the text module with the intended formatting, such as bullets, and apply an inline condition afterwards. 

See töö on litsentseeritud Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported litsentsiga  Süsteemi Creative Commons tingimused ei kehti Twitter™-i ja Facebooki postitustele.

Juriidilised märkused   |   Privaatsuspõhimõtted veebis