I have a team creating time cards in quickbase. Right now I'm using "Now()" to populate the start time of the time card when they punch a button to clock in. The problem is that this appears to clock in at the time the page was last refreshed, not necessarily the current time. Is there a way to capture the current time when the button is clicked?
One thought would be for the button to refresh the page first when clicked, followed by creating the record with the now() function. ideally that would be seamless to the user so user would not have to click refresh and then the button. Not sure how to do that though.
You may also need to write some rules around the fact that it should only populate once - if you have a Parent record related to the Time-Entry record; you might be able to better do this with a snapshot field instead. Create a Lookup [Date/Time] (now()) formula field into your time-card entry table; and snapshot this value when the record is saved. This snapshot value will never change unless you re-link the time card to another parent record.
I need something similar. When a "Completed" checkbox is ticked, a Date/Time field is populated with the current timestamp. I created a form rule and it works, however, I have issues when working on grid edit view.
I don't have a parent record. What I have here is a report, then I click on "Grid Edit" and edit the records there.
Thanks in advance.
So new table called NOW and a field in the table with the formula date time of Now(). Create 1 record, it will be record id of 1. In the details table make a formula field of
Make relationship where 1 now record is related to many detail records based in that formula field. Then look up the Now() value calling it [Now lookup] and then make a snapshot of that now value lookup field.
I created a table called Now with a field called timestamp and created a record.
My details table have a field called "Date Completed" which makes the snapshot from the "Now - timestamp" field.
My question is: where am I going to add the formula "If([checkbox]=true, 1)"?
What does the "1" value mean there? I did not understand how the snapshot field will be populated.
In the now table I assume that it's a formula date time field with the formula of
The record id of the only record in the Now table is 1.
In your details table create that formula field which will also have a 1 in it, but only once the status is Completed. (ie that is the answer to your question.)
Make a relationship with that formula,field as the reference field on the right side of the relationship. Lookup the time stamp field from the now table down to the details table, and then make a snapshot of that lookup field.
The script (1) saves the original click handler function, (2) removes the click handler from the Save button and (3) creates a new click handler which we control. In this case the new click handler stuffs the current time into the field with fid=6 when the Save button is clicked but the general arrangement of code could perform a (1) validation, (2) throw up a confirmation dialog or (3) perform some other function prior to proceeding to the normal Save functionality.
This method of gaining control of QuickBase's forms is preferred to more invasive techniques as it does not change the DOM or redefine QuickBase functions. In a very natural way this technique simply gives the user priority over handling a click on the Save button and then after some custom processing of the form conditionally calls QuickBase Save button if that action is warranted. After all, who should be in control of your form, you or others?
My Now table had a Key field called Yes / No and I entered two records, one for Yes and One for No in that Key field. Those will be the choices for the Project Completed field in the Project table. I added a formula field to the Now table If([Yes / No]="Yes",Now()).
Then I made a relationship back to the Projects table so that the choices for the Project Completion will come from the Now table.
That worked. In Grid Edit the snapshot field will alternately populate and blank out of the Yes / No field in the details table is changed. Here is a link to the app https://yqc.quickbase.com/db/bi9r766n3?a=td you can click though an ask for permission and I will give you admin permission.