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.
LongSFID(1) 1 = 15 character Salesforce Id (can be a variable)
%%[ var @contactId set @contactId = ‘0036000000QKv5z’ set @longContactId = LongSFID(@contactId) ]%% %%=v(@longContactId)=%%
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).