- Posts: 17
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
4 years 7 months ago #187968
by ixtambay
Auto Populate Hidden Date Field For Statistics was created 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!
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 7 months ago - 4 years 7 months ago #187972
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Auto Populate Hidden Date Field For Statistics
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 7 months ago - 4 years 7 months ago #187977
by DenisChenu
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.
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"))}
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 7 months ago #187986
by Joffm
Of course, I missed the curly brackets.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Auto Populate Hidden Date Field For Statistics
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 7 months ago #188122
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Auto Populate Hidden Date Field For Statistics
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
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.