Knowledge Base
How can we help?

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:

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()) + ":" +

pad2(today.getSeconds());

var query = db.getAPIQuery(pathSheet);

query.addFetchDomains(recordField);

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

entry.setFieldValue(recordField, fmtValue);

entry.save();

}

}

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

If your sheet URL is https://www.ragic.com/accountname/tabname/1

And

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.)

Top of Page
Learn more about Ragic:
Why we created Ragic
Webinars
User Guide
Ragic Pricing
Applications
Keep in touch:
Blog
Facebook
YouTube
Ragic, Inc.
1-888-666-8037
Terms
Privacy
info@ragic.com