I need to update a time field with the time a

(Rick Haden) #1

I need to update a time field with the time an activity stops with the actual “now” time.

Either automatically when I save the record, or manually just before saving the record.

Any recommendations?

1 Like
(Stephen Mattison) #2

@Rick_Haden

EASY!

Automatic upon Save would be slick, and I’m pretty sure it’s doable but I would set up a “Stop” button for this. You’ll need two columns [Stop Now] and [End Time].

[Stop Now] will be a one option Data Validation column in your Spreadsheet, to make it a Button in your App, you must check “Reject other values” when setting up Data Validation in your Sheet.

Upon Regeneration of that Table in your App, this column will/should be set as an Enum column.

If this column isn’t automatically set to display as a Button, go in and change that so it’s a Button.

Set your [End Time] column as a Change Timestamp and add “End Time” (no quotes) as the trigger column.

Now, when you click the “Stop” button, it will add current Date/Time to [End Time]. You could set up both options and then track how much time they wasted between manually clicking Stop button and actually Saving the record…HAHA, that’s the long-time Service business owner coming out of me!

1 Like
(Michael) #3

@Rick_Haden Another option, assuming you already have a column to record the time, create an action that updates that field and set the action to ‘Do Not Display.’

In the UX editor, set the ‘Event Actions’ , Form Saved to trigger that action. This will update the time when the form is saved.

2 Likes
(James Samuel) #4

@Rick_Haden Did you make this work?

1 Like
(Steve Coile) #5

@Michael’s suggestion is the right one.

2 Likes
(James Samuel) #6

Great thanks @Steve,
I got @Michael’s solution to work :slightly_smiling_face:

I would like to refine it a little, and any help would be appreciated…

How can I stop the STOP button appearing, if the record has a Stop time recorded, or perhaps more correctly, only appear if there is no data in the Stop time field?

2 Likes
(Steve Coile) #7

In the action configuration, you can set a condition for when it will take effect. Set that condition to the expression, ISBLANK([Stop time]).

2 Likes
(James Samuel) #8

Beautiful - that worked @Steve . It’s super helpful to be able to get tips/answers like this, as it sets me on a path of knowing better where to look for answers. So big thanks!

3 Likes