LongSFID Function

The LongSFID function converts the 15-character case sensitive Salesforce Id to the 18-character case-safe Salesforce Id. The 18-character Salesforce Id is returned. You need to have the connector enabled and configured correctly in order for this AMPscript function to work. You do not need to have the object synced via Synchronized Data Extensions.

A simple use case in using the LongSFID function where you would like to store the 18-character case-safe Salesforce Id in a data extension since data extension text values may not recognize case-sensitivity.

Syntax:

                    

LongSFID(1)
1 = 15 character Salesforce Id (can be a variable)

                

Example:

                    

%%[
var @contactId
set @contactId = ‘0036000000QKv5z’
set @longContactId = LongSFID(@contactId)

]%%
%%=v(@longContactId)=%%

                

Output:

0036000000QKv5zAAD

Explanation:

The LongSFID function is used to convert the 15-character Salesforce Id (which is case sensitive) into the 18-character Salesforce Id (which is case insensitive).

Related functions are the CreateSalesforceObject function, RetrieveSalesforceObjects function and the UpdateSingleSalesforceObjects function

Leave a Reply

Your email address will not be published. Required fields are marked *