Skip to content

Set a Field Value to Today's Date

Legacy (Process Designer)

This page describes a script for the Modify Your Metadata activity of Process Designer. It was replaced by the Custom Step in Workflow. The script may not run as a Custom Step without changes. For new work, use the Custom Step reference.

If you want to set a value to Today's date, which is something available within SharePoint as an option, but not all other repositories, you can reference the example script below for use in the Modify Your Metadata activity.

batch.Documents.forEach(function (doc) {
    todaysDateValue = new Date(); 
    builder.SetDocumentMetadata(doc.DocumentId, "Index", "DateProcessed", todaysDateValue);
});