Using tc:conditional
Comparing Custom Fields
The following are examples of how tc:conditional
can be used to compare a custom field value with the value specified in the tag to include static text and retrieve data.
Date |
|
Number |
|
List |
|
Check Box |
|
Text |
|
Comparing Sub-objects
The following example will check to see if an assignee with the role `Supervisor' is added to the claim. If so, it will include the information nested within the tc:conditional
tag. If not, nothing will be included.
<tc:conditional compare="System[Assignee],Adjuster">Please contact your claim adjuster <tc:loop select="AssigneeList" qualifier="Type_TreePosition=CLAM_ADST"><tc:data select="User"><tc:data select="Contact"><tc:data select="FirstName" /> <tc:data select="Name" /> at <tc:data select="DefaultPhone/PhoneString" /></tc:data></tc:data>.</tc:loop></ tc:conditional>
The following example will loop through all of the assignees within the claim record to see if any of the assignees have the skill 'Adjuster' in their contact card. If so, it will include the information nested within the tc:conditional tag
. If not, nothing will be included.
<tc:loop select="AssigneeList" qualifier="Type_TreePosition=PHON_BUS1"><tc:data select="User"><tc:data select="Contact"><tc:conditional compare="System[Skill],Adjuster">Please contact <tc:data select="FirstName" /> <tc:data select="Name" /> at <tc:loop select="PhoneList" qualifier="PHON_BUS1"><tc:data select="PhoneString" /></tc:loop> if you have any questions regarding your claim.</tc:conditional></tc:data></tc:data></tc:loop>
Testing for Existing Data
The following samples show how tc:conditional
is used to see if data exists for system fields or sub-objects. If data exists, the nested information is included. If not, nothing is included.
Testing System Fields
The following example will test to see if the claim is closed. If so, it will include the static text and the date that the claim was closed.
<tc:conditional test="ClosedOn">
Your claim was closed on <tc:data select="ClosedOn" / >.</tc:conditional>
The following example will test to see if the claim is linked to a policy. If so, it will include the static text and the policy number.
<tc:conditional test="Parent">
This claim is in regards to Policy Number <tc:data select="NumberString" />.</tc:conditional>
Testing Sub-objects
The following example will test to see if any assignees are assigned to the claim. If so, it will include the static text and loop to find all the assignees with the role `Adjuster' and bring in the nested information.
<tc:conditional test="AssigneeList">Please contact your claim adjuster <tc:loop select="AssigneeList" qualifier="Type_TreePosition=CLAM_ADST"><tc:data select="User"><tc:data select="Contact"><tc:data select="FirstName" /> <tc:data select="Name" /> at <tc:data select="DefaultPhone/PhoneString" /></tc:data></ tc:data></tc:loop>
if you have any questions.</tc:conditional>
The following example will test to see if the claim includes the category `Auto'. If so, it will include the static text in the letter and retrieve data from the specified system and custom fields.
<tc:conditional test="Detail[CLAM_AUTO]">
We have the following information about your auto accident.
Date of Accident: <tc:detail select="CLAM_AUTO/AccidentDate" />
Loss Location:
<tc:detail select="CLAM/LossLocation" />
Claimant: <tc:detail select="CLAM_AUTO/Claimant" />
Policy Number: <tc:data select="Parent"><tc:data select="NumberString" /></ tc:data></tc:conditional>
Including Information When Certain Conditions Are Met
The following sample shows how tc:conditional
can be used to include the appropriate pronoun based on the gender of an individual. In this sample, the pronoun he/she or his/her is based on whether the claimant is male or female.
|
|
Header |
|
Content |
|
Dear |
|
We were notified of your recent auto accident with |
|
Based on |
|
Sincerely, |
|