{{system.DateTime}} token doesn't work in Marketo form

Level 1

{{system.DateTime}} token doesn't work in Marketo form

I want to create a Snooze option in the preference center. I created a DateTime field and used it in a form, I set the stored like this:


It used to work perfectly until today, the stored value was 1 or 3 months away from the form submission date. Now I tried to test it again, and nothing happens, the value isn't written in the logs (even if I use the token only, without adding more days to it). Does anyone know if anything changed in Marketo or why else it could stop working?




Marketo Employee

Re: {{system.DateTime}} token doesn't work in Marketo form

Hi Anastasia,

I'm not sure what would have made this stop working, but instead of doing the +days in the field, you can create smart campaigns to manage their Marketability/Snooze Preference, which could be easier to manage (it's how we recommend builds like this)!


Smart List: Trigger of Data value change of "Snooze for 30 Days" from False to True (you'd need to update the values submitted in your form for this to work)

Flow: Data Value change: Marketing Suspended = True, Wait 30 Days, Data Value Change = Marketing Suspended = False


This will automatically suspend them from Marketing emails across your Marketo instance for the 30 day period, and unsuspend them automatically as well. You'd create a second smart campaign with the same thought process for the 60 day suspension. You can also create an update a Marketing Suspended Reason field, to document why a person was suspended. 

Tags (1)
Level 10 - Community Moderator

Re: {{system.DateTime}} token doesn't work in Marketo form

This could only work in general because of the unique behavior of DateTime field, where you can set (using Change Data Value) a DateTime field to a literal date math expression like 2020-10-14 16:43:29 + 30 days. This is still possible in a flow.


But for <select> elements on Marketo forms, there's now an additional layer of validation where the submitted value must be one of the verbatim option values in Form Editor.  (This will cause some people's custom form behaviors to break, btw.)


Note this doesn't apply to Hidden fields, or even to Text fields, since naturally there's no preset list of options for those. So you could in fact still accomplish the same thing via JavaScript. Have the actual DateTime field be a Hidden field; the Select is a placeholder field with some hard-coded options for 30/60/90 days. On submit, set the Hidden DateTime field based on the current JS time + whatever.