Custom Date Format | XM Community
Skip to main content

Hi all,
I am trying to use default choices to have three separate form fields auto-populate the current day, month, and year. See below:
Qualtrics.pngHowever, I need to create custom date fields because none of the default current Date/Time piped text options separate the day, month, and year. I am guessing there is a way to use embedded data to create custom date fields, but I cannot figure out what the syntax would be. Here's what I've tried (it hasn't worked):
image.pngCould someone help me figure out what the correct syntax would be?
Thanks so much.
Leah

Hi there, your Embedded Data fields look okay to me except the 'm' for month should be lower case. Also make sure that the Embedded Data element is set at the top of the Survey Flow. Then for the Form Field, add Default Choices and insert the Embedded Data field for each, like in the below:
FormField_Today.png


Year (4 digits) - ${date://OtherDate/Y/+0 month}
Month (2 digits) - ${date://OtherDate/m/+0 month}
Day (2 digits) - ${date://OtherDate/d/+0 month}


https://community.qualtrics.com/XMcommunity/discussion/comment/53947#Comment_53947This worked! Thanks so much.


Does anyone know how I can get the day of the week the survey comes in as embedded data in the survey flow?  We want to exclude surveys that come in on the weekends for our ticketing SLA reporting.  Thanks for any tips, this looks like a knowledgeable bunch.


HI @kevinmc ,

You can look into below discussion to get day of the survey:
 

Hope this resolves your query😊!!


This is fantastic!!  Thank you!  I never would have figured this out   

 

Any way how I could also program during or after hours?   So flag anything outside of 8-5 est. 


Hi @kevinmc ,

Certainly you can do that by creating an embedded data named  “time” and set its value to this “${date://CurrentTime/MT}”.
Recommend you to use Military time (${date://CurrentTime/MT}) only as it does not have AM and PM and allows easier logical operation if needed in future using JS.

Hope this resolves your query😊!!


@TomG this one worked for me but what does the “/+0 month” do in the syntax? is there some documentation i can look at to know what the correct suffix to use?

thank you!!! 


@TomG this one worked for me but what does the “/+0 month” do in the syntax? is there some documentation i can look at to know what the correct suffix to use?

thank you!!! 

The “/+0 month” means “Plus zero months”. You could do “/+1 month” and it would be one month from now.  You can also subtract and use other units like day or year. There isn’t any documentation that I’m aware of.  The date formatting/math is similar to what is in php, but not exactly the same.


Year (4 digits) - ${date://OtherDate/Y/+0 month}
Month (2 digits) - ${date://OtherDate/m/+0 month}
Day (2 digits) - ${date://OtherDate/d/+0 month}

Hi @TomG ,

I need to get current month in string not in digits. for ex : July , October. Is there any piped text for this without using Javascript because my survey JS is getting blocked by CORS so looking for an alternative ?


Year (4 digits) - ${date://OtherDate/Y/+0 month}
Month (2 digits) - ${date://OtherDate/m/+0 month}
Day (2 digits) - ${date://OtherDate/d/+0 month}

Hi @TomG ,

I need to get current month in string not in digits. for ex : July , October. Is there any piped text for this without using Javascript because my survey JS is getting blocked by CORS so looking for an alternative ?

Hi @Sura ,

You can try and play around with m and M.

I think ${date://OtherDate/MMMM/+0 month} may work. Use MMM if you want the 3 letters form. 


Leave a Reply