Format Date MM/DD/YYYY for use in a webhook | Community
Skip to main content
Adam_Blinzler2
Level 2
June 20, 2018
Solved

Format Date MM/DD/YYYY for use in a webhook

  • June 20, 2018
  • 2 replies
  • 5788 views

I am looking for a way to change the date format from YYYY/MM/DD to MM/DD/YYYY when sending a Twillio sms message using webhooks. My understanding is that you cannot use Email Scripting Tokens in a webhook only basic text tokens and lead tokens.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Grégoire_Miche2

On top of Sandford’s point, we usually prefer text tokens to date tokens when using dates that should be displayed or used in webhooks, precisely for this reason.

Greg

2 replies

SanfordWhiteman
Level 10
June 20, 2018

I am looking for a way to change the date format from YYYY/MM/DD

For Marketo Date/DateTime fields, the date format is yyyy-MM-dd (hyphens, not slashes). That's standard ISO 8601 date format.

The only way to change that output format is to pass the field through another webhook (before sending to Twilio) that copies the Date, in a different format, to a new String field created for that purpose.  Then pass that String field to Twilio.

Grégoire_Miche2
Grégoire_Miche2Accepted solution
Level 10
June 20, 2018

On top of Sandford’s point, we usually prefer text tokens to date tokens when using dates that should be displayed or used in webhooks, precisely for this reason.

Greg

Adam_Blinzler2
Level 2
June 20, 2018

Thank you guys. I was hoping they would be a different workaround but it looks like we will create duplicate fields one as a text field for display and one as a date field for the program. I am not sure if it has been asked before, but I did create an idea of being able to use Email script tokens in webhooks. Thank you again for your quick replies.

Jay_Jiang
Level 10
June 20, 2018

We use a php endpoint to receive the webhook data from Marketo and transform the data before forwarding the data to Twilio. For us it was much easier to write logic to standardise phone numbers before sending to Twilio than to update the whole database. Transforming the formatting of dates would be very straightforward.

In essence you're using up some of your webserver resources to free up some of Marketo's