How to retrieve data from the 'AttachmentData' column in Email Data Source Adapter?

How to retrieve data from the 'AttachmentData' column in Email Data Source Adapter?

book

Article ID: KB0077302

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization 8.0, 8.1

Description

When executing any table from the Email data source adapter, the following message that is returned in the 'AttachmentData' column of the tables.

"AttachmentData: Available when specifying only a single message Id and DownloadAttachments=true"

Issue/Introduction

How to retrieve data from the 'AttachmentData' column in Email Data Source Adapter?

Resolution

Here are the steps to be followed to resolve this issue:

1. Create a Packaged Query on top of the table added from Email data source.  Here is the sample-packaged query.

SELECT * FROM Inbox WHERE Id=13 and DownloadAttachments=true

Note: The data from the 'AttachmentData' will be retrieved only if the Id is mentioned for a specific message in the WHERE clause. Another important field is the "DownloadAttachments=true" parameter as this is required to get the data from the column.

2. Execute the Packaged Query. If the query is successfully executed, the following result is returned
   "AttachmentData: aGVsbG8="

Note: The data from the attachments file is returned in the Base64 encoded format instead of the actual data.

3. To view the actual data in the TDV Studio, a custom procedure may need to be written on the 'AttachmentData' column that will further decode the data and convert the Base64 encoded data to readable format.