---
# System prepended metadata

title: Explanation functionality

---

# Explanation functionality

## Bot name for widget

#### Algorithm
```
customName = `${botEnitity.firstName} ${botEnitity.lastName}`;
customName = customName.trim().length ? customName : bot.name;
```
<details>
  <summary>Check this place</summary> 
  
 ![](https://i.imgur.com/63MXH4W.png)
 ![](https://i.imgur.com/ec58JiO.png)
 ![](https://i.imgur.com/8No8675.png)
 ![](https://i.imgur.com/N1U5pQo.png)
</details>

## Message Sender Label

A Message Sender Label is prepended to a Message and is displayed as part of a Message to provide a visual indicator of the sender.  It is not part of the Message itself.  Its format can differ by Platform.

#### Algorithm
```
 switch (entity.entityTypeId) {
    case entityType.user: {
      result.senderLabel = !entity.firstName && !entity.lastName
        ? defaultValue.label.notFound
        : `${entity.firstName || ''} ${entity.lastName || ''}`;
      break;
    }
    case entityType.team:
    case entityType.rakeSystemUser:
    case entityType.inContact.agent:
    case entityType.inContact.systemUser: {
      result.senderLabel = entity.firstName || '';
      break;
    }
    case entityType.bot: {
      result.senderLabel = `${entity.firstName || ''} ${entity.lastName || ''}`;
      break;
    }
    default: {
      result.senderLabel = defaultValue.label.default;
    }
  }
  result.senderLabel = result.senderLabel
    || entity.firstName
    || entity.lastName
    || entity.email
    || entity.phoneNumber
    || `entityId:${entityId}`;
```

Example: 
>Test3: Hello

message: ``` { label<messangeSenderLable>: 'Test3', text: 'Hello' } ```
after inContact module
message: ``` { label<messangeSenderLable>: 'Test3', text: 'Test3: Hello' } ```


message: ``` { label<messangeSenderLable>: 'Mykola Jakowel', text: 'Hello again' } ```

Converted to:  
>Facebook platform - Mykola Jakowel
>Hello again