Mapping Base64 File Attachment Field from SQL to CRM in TIBCO Scribe® Online

Mapping Base64 File Attachment Field from SQL to CRM in TIBCO Scribe® Online

book

Article ID: KB0077982

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) -

Description

There are scenarios where attachments (e.g. .docx, .pdf, .xlsx) that are stored in SQL server in a field in Base64 format need to be migrated into CRM.
The issue is the source field is a string with a varchar(max) data type but the target is a Byte Array data type. 
This causes a data mismatch type of error when mapping the fields.
The solution is to convert the varchar(max) to varbinary(max) using the example below.
See the attached document for more detailed information

CAST(N'' AS XML).value(
'xs:base64Binary(sql:column("body" ))'
, 'VARBINARY(MAX)'
) AS "body"

Issue/Introduction

This article describes the steps for mapping SQL Server Base64 attachment fields to CRM

Attachments

Mapping Base64 File Attachment Field from SQL to CRM in TIBCO Scribe® Online get_app