Knowledge Base
How can we help?
Full Site Search

Generating last modification date & time of a specific field in the entry

In Ragic, you can set up default value to auto populate a date field with the last modification date & time of the entry. However, if you need to auto populate the field with the last modification date & time of a specific field in the entry, you’ll need to add a script to achieve it.

Please follow this guide to add your script:

* Note: the following steps only apply to independent fields. Subtable fields cannot be set up this way.

Step 1: Open the Ragic workflow editor

Right-click on any of the application tabs or sheets and select Javascript Workflow or Global Javascript Workflow, which will take you to the Workflow Module.

Step 2: Switch edit page to "Global Workflow"

Step 3: Paste the following code and save

function setLastModifiedOnField(pathSheet, observeField, recordField) {

if (param.getOldValue(observeField) !== param.getNewValue(observeField) ||

param.isCreateNew()) {

var today = new Date(new Date().getTime() + account.getTimeZoneOffset());

function pad2(n) { return n < 10 ? '0' + n : n }

var fmtValue = today.getFullYear() + "/" +

pad2(today.getMonth() + 1) + "/" +

pad2(today.getDate()) + " " +

pad2(today.getHours()) + ":" +

pad2(today.getMinutes()) + ":" +


var query = db.getAPIQuery(pathSheet);


var entry = query.getAPIEntry(response.getRootNodeId());

entry.setFieldValue(recordField, fmtValue);;



Step 4: Switch edit page to "Post-workflow" of the sheet you'd like to add this script

If your sheet URL is


The field whose last modification date & time you’d like to generate is "Active Status" (field ID 1003114), and the field where you’d’ like to record last modification date & time of field "Active Status" is "Last Edit (status)" (field ID 1003115).

Add this to the Post-workflow:

setLastModifiedOnField("/tabname/1", 1003114, 1003115);

Don't forget to save your changes.

(The populated date & time value is based on the timezone set in your Company Setting.)

*Please note that when creating a new entry, the last modification date & time will be auto-generated after saving even if the the specific field is not filled. If you wish to keep the last modification date & time empty in this case, you can replace with below script in your Post-workflow:

if(param.getOldValue(1003114) !== null || param.getNewValue(1003114) !== "" ){

setLastModifiedOnField("/tabname/1", 1003114, 1003115);


Top of Page
Learn more about Ragic:
Why we created Ragic
User Guide
Ragic Pricing
Keep in touch:
Ragic, Inc.