Troubleshooting and support for Transact XML Message Scripting

Read this section to learn how to resolve message scripting issues in your transactional emails.

Issue with numeric or boolean helpers

Learn how to resolve issues with numeric or boolean helpers when performing equality checks or comparisons.

Symptoms

You’re having problems trying to do numeric or boolean equality checks or comparisons.

Resolving the problem

  • Use JSON scripting context, instead of XML personalization fields.
  • If you are using AGE, enter a numeric number in the JSON scripting context.

    Example with code

    {{#xif ‘Age >= 18’ }}Vote!{{/xif}}

    Example with context

    {“Age” : “3”}, the result would be “Vote!”

    Example with context

    With context {“Age”: 3}, the result would be empty string

Do not see scripted personalization

Review the list to resolve this issue.

Symptoms

Scripted personalization does not show in the transactional email.

Resolving the problem

Verify the following items to resolve this issue:

  • Is the field in your context (either JSON or XML personalization field)?
  • Does the field name case match between your scripted code and your context data?

Error: Too many tokens found, expecting [number] in expression [expression]

Recommended. The shortdesc element is optional and can be either on its own or inside an <abstract> element..

Symptoms

The error is generated from the code.

For example:{{#xif ‘PERSON AGE >= 18’ }}Make sure you vote!{{else}}No voting yet{{/xif}}

Resolving the problem

  • Do not include a space in PERSON AGE in the xif expression.
  • Trying to use quotes around PERSON AGE in the expression does not resolve the problem.

    For example, suppose you have the code: {{#xif ‘”PERSON-AGE” >= 18’ }}Make sure you vote!{{else}}No voting yet{{/xif}}

    A context of {“PERSON-AGE”: 21} results in an error: “PERSON-AGE” was not found in the current context. This error occurs because it is literally expecting “PERSON_AGE” with the quotes to be the field name in the scripting context.

    A context of {‘”PERSON-AGE”’: 21} (where PERSON_AGE is surrounded by double quotes within single quotes) renders the scripting xif code without error.

User response: Optional. When you have particular actions that are performed by particular users, use one or more of the ts*Response elements.

Join The Discussion

Your email address will not be published. Required fields are marked *