Hello all.I’ve a problem to put a default time into calculation column.Someone can help me please? NB: For exemple I try to type this: time(‘16:00:00 PM’) ,but it’s not good.
Welcome to the community, @mlthepower! You could use the now()
function to get the current time in KoboToolbox as outlined in the image shared below:
In the survey tab of your XLSForm:
Data entry screen as seen in Enketo:
Reference XLSForm:
Default Today’s Time_now().xlsx (9.6 KB)
Or, if you still wish to follow your custom format, you could change the question to text
type, and under the default
column, you could type the time you wish to display as shown in the image below:
But please note that this will give you a string output.
Ok thank you for your support, but the idea that’s just to do the difference between now and 16:00:00 PM in the calculation field.I process like that: decimal-time(${time2}-decimal-time(${time1})
And i’ll bring the result in relevant for the next question.But it doesn’t walk
This is because it was captured as a string input.
Ok instead, i use: if((${decimalnow})>0.850,1,2) after converting now() into decimal in calculation colunm and at the end i bring the name (1) into relevant column .Sometimes it walks but sometimes it does’nt walk.Thanks