How Can We Help?

After save script

You are here:

Enable after save script – enables executing a custom js script right after an item has been saved.

It is possible to execute a custom script right after a form item has been saved. This allows you to set custom values of form fields with the possibility to use all the server-defined values as well (e.g. the ID field, which is not available before a new item gets saved into SharePoint).


The example below will show you how to prepare a custom script which will update the “TextField” field of an item with a value that will combine two other field values: “ID” and “Date”.

let date = getDateTime("Date", "ddMMyy") 
let id = getValue("ID"); 

setValue("TextField", id + "_" + date);

When the ‘Date’ field will be empty the error will occur, however, the form will be saved (only the ‘TextField’ value won’t be changed).

List of available API functions to use in after save script:

Returns the value of a field.
Returns the value of a date/datetime field in the provided format. For a list of possible formats, see here.
Sets the value of a field.

Table of Contents

Newsletter sign-up