Dear Open Foris team, I have a survey where I create a unique code based on the concatenation of the date and time. date_indiv: default value = idm:currentDate() time_indiv: default value = idm:currentTime() code: default value = concat(date_indiv,"-",time_indiv) How can I modify my expression to obtain a code which includes "0", for example "0912" for 9h12: thus "20200604-0912". My current expression gives me "20200604-912"; so it seems to do it automatically for the date but not for the time. Thanks a lot in advance, Bruno asked 04 Jun '20, 07:23 bsenterre |
Hello, For the same question I used the nexts expressions in the default value: concat(substring(date,3,6),"_",time) apply when time>=1000; concat(substring(date,3,6), "_0",time) apply when time>=100; concat(substring(date,3,6), "_00",time) apply when time>=10; where date is a field with default expression idm:currentDate() and time with idm:currentTime() LluĂs answered 04 Jun '20, 07:47 lcomas |
Thanks a lot for your speedy reply. It worked. Best wishes, Bruno answered 05 Jun '20, 10:49 bsenterre |