Portal for Support Agents

How to build dynamic content using CASE Statement (WHEN... THEN... ELSE)

This article is intended for the technical Administrator of Xink. 

It contains technical detail regarding the use of logical constructs to deploy content based on values found in application's database fields. The feature works very similarly to an IF...THEN statement.

Would you like to see different content supplied to email signatures, based on a logic decision, made behind the scenes? 


With CASE statement, you create dynamic signature content, based on the value found in one field; 

  • E.g. unique signature content based on country, company, department, etc.

The decision construct, integrated to the body of one signature definition, may create a great number of its descendants with minor changes or alter the whole signature’s overall appearance. 

Whatever you want! It depends on what goals you are pursuing and the kind of varying emphasis you want to place on the standard signatures’ user base from different departments or companies etc. to attract the target clients.

How to create dynamic language sign off using only one template

Let's say that you would like to create different email signature sign off based on country field. 

  • United States = Best
  • United Kingdom = Kind regards
  • Germany = Mit freundlichen Grüßen
  • Australia = Best regards
  • All other countries = --
{$$CASE(Country)$$WHEN(United States)$$THEN(Best)$$WHEN(United Kingdom)$$THEN(Kind regards)$$WHEN(Germany)$$THEN(Mit freundlichen Grüßen)$$WHEN(Australia)$$THEN(Best regards)$$ELSE(--)$$}

Syntax definition

Compose your conditional statement using template below:

{$$CASE(Field name)$$WHEN(Value to test)$$THEN(string to place in the signature if field value matched)$$ELSE(default string)$$}

P.S. There are curly brackets at the beginning and end of the statement and double dollar signs before each keyword. Parentheses after each keyword enclose the parameters:

field name to check
value to test for (do not use quotes for the string to check for)
substitution string used, if preceding "when" matches field value (do not use quotes for the string to insert)
substitution string used, if preceding "when" doesn’t match field value (do not use quotes for the string to insert)

While the system engine renders the signature, it compares the value of the field named in brackets, after the CASE keyword, to the strings in the brackets, which follow the WHEN keyword(s). 

If the field value matched one of the strings, then the sub-string in brackets following the THEN keyword is placed into the output. 

If none of the WHEN values match, the sub-string following the ELSE keyword is displayed.

Below example happens to show two possible values and a default to cover other values. Adding additional WHEN…THEN tests, would allow you to test for additional String matches and provide additional customization.

The constants of THEN and ELSE strings may be styled via HTML or with a help of toolbar.

Place your conditional construct in HTML source and use Preview to validate:

  • Put the desired conditional construct into the body of the signature in the HTML mode:
  • Click Signatures in the Left-hand menu and open the signature, where you want to apply the condition:

On the screenshot above you can see field names which could be used in CASE section. As you can see, you could be driving intelligent content decisions off of any field we store. Signatures could be unique by [City] [State][Country] [Department]or any other stored value, that drives a differentiation in Marketing Message. 

Let's see this behavior in an example:

{$$CASE(Department)$$WHEN(IT)$$THEN(a modest geek’s signature)$$WHEN(Marketing)$$THEN(a flashy sales manager’s signature, <font color="red">highlighted in red</font>)$$ELSE(signature by default for other departments)$$}
  •  Employee – Michelle Archambault; Department – IT:

  • Employee – Patty Adams; Department – Marketing:

  • Employee – Sue Anderson; Department – empty field:

Place your conditional construct in HTML source and use Preview to validate:

Put the desired conditional construct into the body of the signature in the HTML mode:

  • Enter SIGNATURES section and open the signature, where you want to apply the condition:     

  • Click “Source” on the toolbar of HTML Signature tab and add the syntax of CASE wherever you want the satisfied condition to be rendered; then press the same tab “Source” to return from HTML to Design mode:         

    Note the formatting syntax, added to the HTML, to change the text to RED. Your rendering choices are only limited by your expertise with the HTML syntax.

  • Select “Preview” tab, choose the employee from the drop-down list and validate with “ok” button:         

      The condition is satisfied.

We hope this functionality will come in handy to you!

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.