Skip to main content
All CollectionsExamples & Tutorials
Automatically populate a date/time component when a user signs
Automatically populate a date/time component when a user signs

Let's explore how you can automatically populate a date/time field when a user signs

Updated over 5 months ago

The signature component is great for requesting an approval/verification within your form. While Team Forms automatically logs the time stamp of any submissions in the background (against the version history) you may want to populate a date/time field in your form whenever a user signs a signature component. This can be done using the following method:

  1. Drag and drop a signature component and a date/time component into your form.

  2. Under the signature component’s settings, go to the ‘Logic’ tab and find the ‘On Change’ setting. This allows you to enter custom JavaScript code that runs whenever the signature field is updated.

  3. Use this feature to update the value of the date/time component set up in step 1. Enter the following code, making sure to replace ‘dateTime’ with the actual name (in the api tab) of your date/time field:

    instance.root.getComponent('dateTime').setValue(moment().toISOString())

Did this answer your question?