1

I have an ExactTarget landing page where I create leads and campaign members in Salesforce. On my campaign member creation I need to set a field that is defined as a Date field in Salesforce however I cannot seem to find the correct syntax for setting the date field with a value that will be accepted by the Salesforce API. Any help on using the correct syntax is greatly appreciated.

2 Answers 2

2

Acceptable SalesForce Formats:

Date: %%[ SET @date = Format(Now(),"YYYY-MM-DD") ]%%

Date and Time: %%[ SET @datetime = Format(Now(),"YYYY-MM-DDThh:mm:ssZ") ]%%

(Date and Time also accepts offset times like YYYY-MM-DDThh:mm:ss+hh:mm and YYYY-MM-DDThh:mm:ss-hh:mm)

1

It seems that only the second format works when updating to either a Date or Date/Time field. Here's another way to build the proper format which has worked for me.

Concat(DatePart(Now(),"Y"),"-",DatePart(Now(),"M"),"-",DatePart(Now(),"D"),"T00:00:00.000Z")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .