SOLVED

Is there an option to copy values from datetime field to date field

Go to solution
Arvind_Rangaraj
Level 2

Is there an option to copy values from datetime field to date field

Hi,

Q1: Can I sync a date-time type field in Marketo with date field in Salesforce? I want to know if there will be any impact on the data as we have a two way sync for Markeo and Salesforce.

Q2: We are using two fields to capture dates and the field types are "Date-time". We have a new requirement where we need to change the field type to "Date".

"Applied_Lead date"(type = date-time) is a field which captures date values using the token {lead.lead date}}(type = date-time). The field Applied lead date stores data for leads who apply through our website. In all the Website forms we have the field "lead date" which updates when form submission is done and that value is copied to Applied Lead date using the Change Data value step and the token I mentioned above.

For certain fresh leads, we do a list import and for those leads the applied lead date field will be blank(as they have not applied through our website) but the "lead date" field will contain the value when the list import is done.

I tried to import field values of type "Date-Time" to a "Date" type field in Marketo, it shows "Choice had one or more invalid tokens, skipping 15 leads". Does Marketo allow importing values from an old datetime field to a new SFDC custom date field.

Solutions to the above questions will be helpful.

Thanks,

Arvind. R

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Is there an option to copy values from datetime field to date field

Does Marketo allow importing values from an old datetime field to a new SFDC custom date field.

The error you're showing isn't from importing a converted value but from trying to copy a value as-is.

If you export, truncate the field to only the date portion, and actually reimport (from a file) you won't have this problem. Marketo won't say a Date-like string value is an "invalid token" for import into a Date field.

Bear in mind that conversion from DateTime to Date is always lossy, that's why it is not usually allowed when the formats of both sides are known.  If you truncate "2018-07-01T23:59:00" to just "2018-07-01" then convert again to DateTime, you get "2018-07-01T00:00:00" -- almost 24 hours off from the original  So it is understandable that this is not something to silently allow.

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Is there an option to copy values from datetime field to date field

Does Marketo allow importing values from an old datetime field to a new SFDC custom date field.

The error you're showing isn't from importing a converted value but from trying to copy a value as-is.

If you export, truncate the field to only the date portion, and actually reimport (from a file) you won't have this problem. Marketo won't say a Date-like string value is an "invalid token" for import into a Date field.

Bear in mind that conversion from DateTime to Date is always lossy, that's why it is not usually allowed when the formats of both sides are known.  If you truncate "2018-07-01T23:59:00" to just "2018-07-01" then convert again to DateTime, you get "2018-07-01T00:00:00" -- almost 24 hours off from the original  So it is understandable that this is not something to silently allow.