Start - Stop time function based on now()

134
2
Jump to solution
06-20-2018 05:50 AM
ThomasPerriment1
New Contributor III

Hi everyone,

I've been looking into the use of a "Stop" time button (End Standing Time) within a repeat, upon which a related dateTime (Finish Time) would appear with the current time appearing when the stop button (as a likert) is selected. 

My issue is that if I set the default time for the Finish Time to now(), it will give me the time at the first opening of the repeat and not the current time, and if I set the calculate field as now() whilst it does give me the correct time, it will refresh the time whenever I cycle through the repeats (going from 2 of 2, back to 1 of 2).

I am hoping to have a stop button which will set the Finish Time as current time when selected, with this time not automatically recalculating and changing when I go back (current workflow shown below). The XLS form is as follows: 

Step 1: Create first repeat entry.

Step 2: Select Stop button auto-calculating Finish Time to now()

Step 3: Create second repeat entry.

Step 4: Click back to first entry to find Finish Time has updated from 13:45 to 13:46.

Is anyone able to suggest a workaround for this?

Thanks and regards,

Thomas

0 Kudos
1 Solution

Accepted Solutions
DeonLengton
Esri Contributor

Hi Thomas

I havent attempted this yet but one thing caught my eye:

if I set the calculate field as now() whilst it does give me the correct time, it will refresh the time whenever I cycle through the repeats

To stop this from happening you can use the once() function which will force the calculation to only happen once and not each time the user scrolls through the repeat items.

Regards

Deon

View solution in original post

2 Replies
DeonLengton
Esri Contributor

Hi Thomas

I havent attempted this yet but one thing caught my eye:

if I set the calculate field as now() whilst it does give me the correct time, it will refresh the time whenever I cycle through the repeats

To stop this from happening you can use the once() function which will force the calculation to only happen once and not each time the user scrolls through the repeat items.

Regards

Deon

View solution in original post

ThomasPerriment1
New Contributor III

Hi Deon,

Thanks for the quick response! This worked perfectly and was exactly what I was looking for. Thanks for your help.

Kind regards,

Thomas