Is there a way to set an embedded data field to the Survey Send Date? | XM Community
Solved

Is there a way to set an embedded data field to the Survey Send Date?

  • 19 December 2019
  • 3 replies
  • 125 views

Userlevel 2
Badge +6
I want to send a weekly survey to our student interns to enter their work time for the previous week. I originally set up an embedded data field, WeekStartDate as ${date://OtherDate/m%2Fd%2FY/-1 week}. However, if instead of filling out the survey on Monday when I send it, they fill it out on Tuesday, they get the previous Tuesday (and I want Monday). Does anyone know the variable for survey send date that I could use in the field -1 week? Thanks.
icon

Best answer by MichelleM 7 July 2020, 18:42

View original

3 replies

Userlevel 4
Badge +18
Not Really. As a workaround, you can either pass the send date as a query string parameter or add it as an embedded data field in the contact list. This date can then be pulled by declaring the embedded data field in the survey flow.
Userlevel 2
Badge +6
Thanks for the suggestion @Mishraji -- I do have an embedded data field set to the previous Monday but have to manually update it each time. Was hoping I could avoid that!
Userlevel 2
Badge +6

I finally figured out the answer to my own question with some javascript I added to the survey to calculate last week Monday. It is not pretty but it works. (I did have to add a page break in for the variable to display correctly in my survey, thanks to another post that I found that tip)
last Monday java code.JPG

Leave a Reply