# Automate Data Export

### Step 1

Head to the Deploy Tab of your AI Agent, click on “View Analytics”

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FbVGr1iFtQ6N1v2PeuLUc%2F0.png?alt=media)

### Step 2

Once the Dashboard loads, head to the very bottom of the page and open the “Export Settings” tab.

<figure><img src="https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FBbGoFtZimw2YeScUGu5w%2FCron%20Job.jpg?alt=media&#x26;token=05510fcc-3ae2-4b30-82e0-64da4b5ce892" alt=""><figcaption></figcaption></figure>

### Step 3

You can add a code snippet through “Functions”, which can export the data to any external DB.

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FAYJAY3hGKw21Te4XMF50%2F2.png?alt=media)

### Step 4

Click the relevant Function from the drop-down and hit “Save”

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FPRznDGi5ItAWIIFXFAMq%2F3.png?alt=media)

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FDbT36T2gTuBoqvkzyHeL%2F4.png?alt=media)

{% hint style="info" %}
NOTE: The export will only work in the messages tab. The “Messages” section is in the “Details” section as per the screenshot below.
{% endhint %}

![](https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FEsiHKYl4T1fST3UEB40s%2F5.png?alt=media)

{% hint style="success" %}
TIP: You can also trigger a run, whenever you need with the "Run Now" button
{% endhint %}

<figure><img src="https://662560811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5BFP5RUm6rTLXk8wUSTf%2Fuploads%2FdPkMtFOcTe9P1zyeHeaQ%2FScreenshot%202025-02-18%20at%2011.25.52%E2%80%AFAM.png?alt=media&#x26;token=d7bfb999-35aa-44ad-a9fc-e91207a6135f" alt=""><figcaption></figcaption></figure>
