# Format Delpha Conversation messages

## Formatting rules&#x20;

The Delpha messages can contain more than simple texts. By inserting special tags, you can display dynamic and formatted messages.  Tags can be used to modify text style, add icons, add images, add hyperlinks, or insert a variable value. The tags can be used on any message displayed to the user such as:

1. In the builder, via the message/question/answer display text field.

![3.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh4W)

![1.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh4v)\
Formatted message displayed on Delpha\
&#x20;

2. In the apex code, while creating dynamic answers.

![3.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nkf1)

## Supported Tags

### Insert Variables / Record Links

#### Add Variable

Default or custom variable defined in the builder can be displayed in the bot using the following tags:\
Tag: {!VariableName}\
Example: {!CurrentRecordId}

#### Display fields associated with a record variable

Tag: {!VariableName.FieldName}\
Example: {!CurrentRecordId.Email}

#### Display fields associated with the related record&#x20;

\
Tag: {!VariableName.RelatedObject.FieldName}\
Example : {!CurrentRecordId.Contact.Name}

{% hint style="warning" %}
The associated records can be accessed by chaining them as shown above, and you can go on like {!CurrentRecordId.Contact.Account.Name}.&#x20;
{% endhint %}

#### Add Record Link

Tag: \[record Id= value]display text\[/record]\
The value can either be hard-coded or a variable, as shown below:\
Example:\[record id=0031D00000aIxZtQAK]Andy Young\[/record]\
Example:\[record id={!targetRecordId}]Andy Young\[/record]

### Format text

#### Bold Text

&#x20;Tag: \[b]Bold Text\[/b] \
Example: Discover \[b]California\[/b] \
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh68)

#### **Line Break**

Tag: \[br/]\
Example: Discover \[br/]London\
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh5V)

#### **Italic Text**

Tag:  \[i]Italic Text\[/i] \
Example: Discover \[i]Prague\[/i] \
![3.jpg](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh6N)

#### **Underline Text**

Tag:  \[u]Underlined Text\[/u] \
Example:  Discover \[u]Paris\[/u] \
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh6D)

#### **Add Color**&#x20;

Tag: \[color=value]Colored Text\[/color]\
The value can either be [color name](https://www.w3schools.com/colors/colors_names.asp) or hexadecimal code as shown below:\
Example:  \[color=green]Hello World!\[/color]\
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh9M)\
Example: \[color=#FF0000]Hello World\[/color] \
![1.jpg](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003NlZt)

### Insert Resources / Links

#### Add Icon

Tag: \[icon]IconType:IconName\[/icon]\
Example: \[icon]standard:announcement\[/icon]\
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh8d)

{% hint style="info" %}
Delpha currently supports [Salesforce-Lightning design icons](https://www.lightningdesignsystem.com/icons/).&#x20;
{% endhint %}

#### Add Image

Tag: \[img]Image Link\[/img]\
Example: \[img]<https://delphaimage.png\\[/img]\\>
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh97)

#### Add Image and adjust width

Tag: \[img]<https://img.png\\[/img]\\[img> width=50]\
Note: Currently, Salesforce doesn't consider the image height attribute added in the tags. However, the image scaling is respected during rendering.

#### Add External Link

Tag: \[url]external link\[/url]\
Example: \[url]<https://delpha.io\\[/url]\\>
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003Nh9H)

#### Add external link to a display text&#x20;

Tag: \[url=external link]display text\[/url]\
Example: \[url=[https://delpha.io\]AI](https://help.delpha.io/delpha-for-salesforce/delpha-apps/delpha-setup/conversation-builder/https:/delpha.io]AI) for Productivity\[/url]\
![image.png](https://delpha.file.force.com/servlet/rtaImage?eid=ka0EY00000007jx\&feoid=00N5w00000NshhX\&refid=0EM5w000003NhLm)

#### Add an external link to an image

Tag: \[url=external link]\[img width=50]Image link\[/img]\[/url]\
Example: \[url=[https://delpha.io\]\\\[img](https://help.delpha.io/delpha-for-salesforce/delpha-apps/delpha-setup/conversation-builder/https:/delpha.io]\\\[img) width=50]<https://img.png\\[/img]\\[/url>]

{% hint style="warning" %}
For security reasons and to avoid vulnerabilities such as XSS, we only support **our tags**.&#x20;
{% endhint %}
