Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Auto Populate Hidden Date Field For Statistics

  • ixtambay
  • ixtambay's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #187968 by ixtambay
Hi everyone!

I would like to ask if there is a way to auto populate a date field that is hidden so that when I view the statistics a date field would appear under response filters?

Thanks in advance!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago - 4 years 7 months ago #187972 by Joffm
Hi,
Unfortunately I was not successfull in entering something dynamic into the default answer option,
I used an equation to populate the date question.
Both hidden:
1. equation: {MyDate=date("Y-m-d")}
2. Hidden date question with code "MyDate"

And you have a date field in the response filter


Joffm

If you are going to populate with some other than the actual date, please tell us.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 7 months ago by Joffm.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago - 4 years 7 months ago #187977 by DenisChenu
Replied by DenisChenu on topic Auto Populate Hidden Date Field For Statistics
For default value : {date("Y-m-d")} for date of today

With all data format. Since default value is set in PHP : must be SQL date

For another day/date : play with strtotime is the most easy.

For example : {date("Y-m-d",strtotime("tomorrow"))}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 4 years 7 months ago by DenisChenu. Reason: {date("Y-m-d",strtotime("tomorrow"))}
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #187986 by Joffm

For default value : {date("Y-m-d")} for date of today


Of course, I missed the curly brackets.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • ixtambay
  • ixtambay's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago - 4 years 7 months ago #188104 by ixtambay
Replied by ixtambay on topic Auto Populate Hidden Date Field For Statistics
Thanks a lot sir Joffm and sir DenisChenu.

However, after trying it, the statistics shows the date (just like in the photo above) but why doesn't it save the date in the date field when I view it under survey responses.
Last edit: 4 years 7 months ago by ixtambay.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #188122 by Joffm
Hi, most probably you looked at the wrong place.

This value is stored.

It is stored exactly with the code of your "date" question.

Otherwise it couldn't be displayed in the statistics.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: ixtambay
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose