LongSFID

Sales and Service Cloud objects use a case-sensitive 15-digit character as a record identifier. Marketing Cloud Subscriber and Contact records require a case-insensitive identifier. This function converts 15-digit identifiers into 18-digit case-insensitive identifiers.

Argument

LongSFID(1)

Ordinal Type Required Description
1 String True 15-character Salesforce record identifier

NOTE: Marketing Cloud will not allow the import of a 15-digit Salesforce identifier into a Data Extension. The import will return a CaseSensitiveSalesforceID validation error. Fifteen-digit Salesforce identifiers must be converted into 18-digits before they can be stored in a Data Extension field.

Example

The following code converts a Salesforce 15-digit identifier from a landing page URL query string into an 18-digit identifier and it retrieves the corresponding First Name field from a Data Extension with a matching identifier.

%%[

var @shortSFID, @longSFID, @firstName

set @shortSFID = QueryParameter("id")
set @longSFID = LongSFID(@shortSFID)
set @firstName = Lookup("Prospects", "First Name", "Id", @longSFID)

]%%
<p>Hello %%=v(@firstName)=%%</p>

Output

For an id value of 00Q6F00001APnym, the LongSFID function will return 00Q6F00001APnymUAD and display the matching First Name value in the Data Extension.