Formatting a date to send in a WebService JSON free text | XM Community
Question

Formatting a date to send in a WebService JSON free text

  • 2 June 2023
  • 1 reply
  • 68 views

Badge +2

I have a workflow with WebService tasks that send data to an external service with REST API calls.

I can’t figure out how to format a date correctly.

It’s a future date, and the required format is 2023-06-02T15:35:09.000Z where the T and Z are literal letters, and all the date and time fields have to be zero-padded on left.

I found this page: https://www.qualtrics.com/support/vocalize/dashboard-settings-cx/dashboard-data/advanced-fields/custom-date-formats/.  It is for dashboards, but I figured the formatting codes would be consistent.  Not so.

${date://OtherDate/yyyy-MM-ddTHH:mm:ss.000Z/+3 day} produces this in the sent data:

23232323-JunJun-0505EDT1515:0606:4141.000-14400

Can someone please help me with the right syntax, or better yet, point me to the right place to learn?

Thanks!


1 reply

Badge +2

Still experimenting.  I found a post on StackOverflow that suggests using PHP date formatting.

I tried using ${date://OtherDate/Y-m-d\TH:i:s.000\Z/+3%20day}, but it appears to have generated 2023-06-02T14:%.  I’m getting closer.

Leave a Reply