> For the complete documentation index, see [llms.txt](https://docs.borndigital.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.borndigital.ai/insights/workspace/upload/data-sources-text.md).

# Data sources (Text)

This section is used for data sourcing using the manual upload option or integration with other data sources.

Bring the e-mails and texts you want to analyse into the project: let Insights read an Office 365 mailbox, forward e-mails to the project's own address, upload a CSV file, or copy a selection from another project. Mailbox sourcing runs on its own, so new e-mails are analysed without anyone uploading them.

<img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2FdrmXtRGgj2ZGEp1AcEbm%2Ftext-data-sources.png?alt=media" alt="Text data sources — Custom mailbox and upload" width="375">

On-screen elements:

### Custom mailbox

* **Is active**: switch for enabling sourcing from the Office 365 mailboxes set up in **Configure O365**.

{% hint style="info" %}
Only one mailbox type can be active at a time. Activating one mailbox type automatically deactivates the other.
{% endhint %}

* **Configure O365**: opens the connection to your Office 365 mailboxes. Choose one sign-in method on the tabs **Client secret**, **Refresh token**, **Certificate** or **Azure Connect**. A dot marks the method in use; while one method is configured, the other tabs are disabled.
  * **Client secret**, **Refresh token** and **Certificate** – **Client details**:
    * **Client ID**: input field. Fill in a value as per:\
      Azure Portal → Microsoft Entra ID (Azure AD) → App registrations → Application details
    * **Tenant ID**: input field. Fill in a value as per:\
      Azure Portal → Microsoft Entra ID → Overview or organization properties
    * **Client secret** or **Refresh token** or **Thumbprint** (Certificate): input field
      * **Client secret**: fill in a value as per:\
        Azure Portal → Microsoft Entra ID → App registrations → Certificates & secrets → “New client secret”
      * **Refresh token:** enter a refresh token obtained when an OAuth 2.0 authorization code is exchanged for tokens with the required offline-access scope. It can be obtained through the client application or a suitable OAuth development tool.
      * **Thumbprint** (certificate)**:** generate a certificate and then upload it using the button below.\
        Azure Portal → Microsoft Entra ID → App registrations → Certificates & secrets → Upload or generate a certificate
        * **Upload**: button for uploading the certificate. Supported file types: `.txt`, `.pem`, and `.crt`.
  * **Azure Connect** – sign in with a Microsoft account instead of an app registration:
    * **Connect**: signs in with your Microsoft account. When connected, the tab shows the account and the date it was connected, and **Disconnect** removes the connection.
    * Reading a mailbox may require approval by a Microsoft administrator of your organization. If you are an admin, click **Grant admin consent**; otherwise click **Copy admin approval link** and send the link to your IT administrator.
  * **Mailboxes** (on every tab, Azure Connect included): the mailboxes and folders to read. Each mailbox is shown as a chip with its e-mail address.
    * **+**: adds another mailbox.
    * **Email**: the mailbox e-mail address.
    * **Folder IDs**: one or more folders of the mailbox to read. **+ Folder ID** adds a folder; the bin removes one. **Bulk Edit** lets you paste several Folder IDs at once, separated by commas. Folder IDs must be unique and cannot contain spaces or commas.
  * **Should download unread e-mails only** (on every tab): when checked, only unread e-mails are downloaded from the listed mailboxes.
  * **Clear**: removes the stored client secret, refresh token and certificate and disconnects the Azure account. The mailboxes are not read until you configure them again.
  * **Save**: saves the configuration.

{% hint style="info" %}
Configure at least one valid mailbox and folder. Insights reads only the mailboxes and folders listed here – an empty list does not fetch all accessible e-mails.
{% endhint %}

***

### Default mailbox

* **Is active**: switch for enabling sourcing from the project's own e-mail address in the format `analytics-<project_id>@analytics.borndigital.ai`. Send or forward e-mails there to have them analysed.

***

### Mailbox settings

These settings are shared by both mailbox types – they appear on both tabs but are saved once for the project. Save them with the floating **Save** button at the bottom of the page.

* **Use attachments**: switch for processing the attachments. Attachments are downloaded and made available for e-mail attachment processing and analysis.
  * **Max attachments**: input field for capping the number of attachments that can be downloaded.
  * **Max size in bytes**: input field for limiting the size of one attachment. The value converted to MB is shown below the field; the maximum is 20 MB.
  * **Max pages**: input field for capping the number of pages of one attachment.
* **Should Calc Response Time**: switch for adding `email_response_time` to the e-mail metadata. The value represents the difference in seconds between the processed e-mail’s sent time and the latest earlier e-mail in the Inbox with the same conversation ID. If the value cannot be calculated, it may be empty.
* **Use immutable ID**: switch for requesting Microsoft Graph immutable message IDs. Unlike regular Outlook message IDs, an immutable ID remains unchanged when an e-mail is moved between folders in the same mailbox. Enable this when stored message IDs will later be used for actions such as marking an e-mail as read, replying, moving, forwarding, categorizing, or copying it. The ID can still change if the e-mail is moved to an archive mailbox or exported and imported again.

***

### Upload

Upload a `.csv` file with one text per row – for example an export of emails, chat transcripts or support tickets. One file is uploaded at a time, with up to 10,000 rows. You choose the column with the text to analyse; every other column is stored as metadata of the text, so you can filter by it and show it in dashboards.

* **Upload**: button for selecting one CSV file. Once selected, the **Content preview** window opens.
* **Content preview**: window with the parsing options and a preview of the file:
  * **Total Rows**: number of rows found in the file.
  * **Preview Rows**: number of rows shown in the preview (up to 100).
  * **Column to analyse**: drop-down for selecting the column with the text to analyse.
  * ⚙️ **Quotechar**: input field with default value `"`, used to enclose text containing special characters like a semicolon, so that the semicolon within the text is not read as a column separator (**Delimiter**). Example: “New York; NY” stays intact and is not split into columns.
  * ⚙️ **Delimiter**: input field with default value `;`, used for splitting the CSV file into columns.
  * ⚙️ **Encoding**: input field with default value `utf-8-sig`, the text encoding of the CSV file.
  * Preview table: shows the parsed file as per the settings above.
  * **Import**: button for importing the file for the analysis.

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2Fk5JGTI3PnBo7jSz7U8s2%2Fimage.png?alt=media&#x26;token=574d0dea-834d-4857-9bac-c24e42a2551e" alt=""><figcaption></figcaption></figure>

***

### Send text

Type a single text and send it for analysis right from Digital Studio – handy for testing parameters and prompts or for a demo.

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2FstKZKw1rF0M1io5F7Ju6%2Fimage.png?alt=media&#x26;token=0ebe3d31-07d4-44dd-ba26-f3f54baef886" alt=""><figcaption></figcaption></figure>

* **Send text as an email for analysis**: shows the project's own e-mail address in the format `analytics-<project_id>@analytics.borndigital.ai`. Click it to write an e-mail in your mail client, or copy it with the copy icon.
* **Type email text for analysis**:
  * **Email text**: input field for the e-mail body.
  * ⚙️ **Advanced options**: switch showing the options below.
    * **Attachments**: drag and drop or upload files to send with the text – Word (`.doc`, `.docx`), Excel (`.xlsx`), PDF, images (`.png`, `.jpg`, `.webp`, `.gif`, `.tiff`, `.svg`), `.csv`, `.txt`, `.html` and other files.
    * **Metadata (JSON)**: editor for adding metadata to the text in JSON format, for example a subject.
  * **Send**: button for sending the text for analysis.

{% hint style="warning" %}
To send e-mails to the project address from your own mail client, switch on **Is active** in **Default mailbox**. Texts sent with **Send** are analysed without the switch.
{% endhint %}

***

### Copy data from another project

Use it for ad-hoc analysis. Copy only the texts you care about from an existing Text project – for example the e-mails handled by one team, only complaints, one week or one campaign – into a separate project, and try new parameters and prompts on that slice. The production project stays untouched, and you don't have to process all your data again.

Copying itself doesn't analyse anything: each text comes with its existing results, attachments and metadata. To analyse the slice with the parameters and prompts of this project, run **Process** › [**Rerun**](https://docs.borndigital.ai/insights/workspace/process/rerun.md) on the copied version. Copied texts show up in dashboards after that rerun.

1. Create a new Text project for the analysis, in the same organization as the source project.
2. Open **Upload** › **Data sources** › **Copy data from another project** and choose what to copy (fields below).
3. Click **Check** to see how many texts match, then **Copy**.
4. Set up the parameters and prompts you want to try and rerun the copied version.

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2FZiMCcVvlGu9fba1WFUR8%2Fcopy-data-audio.webp?alt=media" alt="Copy data from another project – project, version, dates, one additional filter and the count after Check"><figcaption></figcaption></figure>

On-screen elements:

* **Project**: the Text project to copy from. Only other Text projects of your organization are offered.
* **Version**: the result version to copy. Without a version, the results of all versions are copied and a text can appear more than once.
* **From** / **To**: copy only results created in this period. The dates are in your local time zone, shown in the label. Each boundary can be used on its own.
* Conditions below the dates narrow the selection further, for example to e-mails where a parameter has a given value. They work the same as in Rerun – see [Filters](https://docs.borndigital.ai/insights/workspace/process/rerun.md#filters).

{% hint style="warning" %}
Select a source version unless you intentionally want to copy the results of all versions. Always use **Check** to verify the final number of matching texts before you start the copy.
{% endhint %}

#### Floating buttons

* **Check**: counts the texts that match your selection. If you change the selection afterwards, the count is marked **Warning: Outdated results.** and you need to check again.
* **Copy**: available once **Check** finds at least one text. It copies them into a new result version of this project; the message shows the version number. Copying runs in the background – follow it in **Process** › [**Batch jobs**](https://docs.borndigital.ai/insights/workspace/process/batch-jobs.md).
* **Save**: saves the other Data sources settings of the project. The copy selection is not saved.
