Is there a way to set an embedded data field to the Survey Send Date? | Experience Community
Skip to main content
Solved

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

  • Dec 19, 2019 3:47 PM UTC
  • 3 replies
  • 277 views

MichelleM
Level 2 ●●
Forum|alt.badge.img+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.

Best answer by MichelleM

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

View original

3 replies

Mishraji
Level 4 ●●●●
Forum|alt.badge.img+18
  • Level 4 ●●●●
  • Dec 24, 2019 8:18 PM UTC
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.

MichelleM
Level 2 ●●
Forum|alt.badge.img+6
  • Author
  • Level 2 ●●
  • Dec 26, 2019 6:43 PM UTC
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!

MichelleM
Level 2 ●●
Forum|alt.badge.img+6
  • Author
  • Level 2 ●●
  • Answer
  • Jul 7, 2020 4:42 PM UTC

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