Auto populate time fields

I have an object that has time fields that I want to auto populate in object using a form.  Is that possible and how can I accomplish this? The time fields are a start time and an end time that is located in one of my pages.   

But i think in the above way it create a new records every-time whether user want to crate a record or not after clicking button . 

I also did the same and check there are lot's of empty records just auto populate entry and form rules entry .



Sunny Singla


Rita, are the records your populating in a connected (child) record?

If so, then you can still use the process I mention above to populate the fields...

You still need the intermediate 'form' to create the new record for you but instead of populating the Start and end times with current date/times you set them to a Connected Value (i.e. the existing fields on the 'parent' record. This would be done in an add record form which need have no fields on it (probably a modal popup) and just a submit button (renamed) - it might look something like this:

Note this screen has no input fields but when you click the Create Checks button it updates the record and then creates some connected records - and with no code.

In your case, clicking the button would add the new record and the Record Rules would fill in Start and End times. The form would then re-direct to the new child form where you would actually edit the new record.

With no code, this is about as automated as you can get - the next step would be to make the above form 'auto commit' which requires just 3 lines of Javascript and is basically the same (apart from the view id) for any view you want to use it with:

$(document).on('knack-view-render.view_191', function(event, view, data) {

This is the version of this for the new Standard Theme - if you're using an old theme then you can see the equivalent in the Knack developer documentation. All you need to change is the view number (191 above) - to the view number of the view you want to auto commit.

I do appreciate that coding in Javascript for Knack is pretty horrible - and I've done an awful lot of coding in VBA / Access in my time (and quite a lot in other database languages) - Knack could really do with it's own language to make the learning curve from using user interface tools to coding more accessible!


No there is no other way . 

Using JavaScript it's very small . If you want any help mail me .


Otherwise you can search on google it's not tough . Like $("#fieldID").val($("CentertableColumnField").val());


Sunny Singla 

Julian..... Perhaps I am not explaining the process.  The start time and end time are already in an object table called Center.  All I want to do is to auto-populate the same start and end times from the Center table.... If the user would have to enter a start time.... then hit submit.... they might as well enter the start and end times as they are doing now.  I am trying to avoid this data entry step altogether.

Hi Rita

The answer to this question depends on the detail as always. The end time could be populated using a record rule - but the start could be a bit more of a problem because if you're using a form to create a new record, the record doesn't exist until you save it. 

What you could do is create an add record form which just creates a new record with the Start time completed by a Record Rule (and may have no fields displayed - just the Submit button. This would have a Form rule which re-directs to a new child form which Edits the newly created record - this is where you would have the Record rule to fill in the End time.

This is a little hard to explain but I hope you get the idea - if not come back.

unfamiliar with coding in JavaScript.... Is there no other way to accomplish this? 

Just Use Custom JavaScript to do this ..

When view is loaded then fill those value 


Sunny Singla