Adding an approval mechanism to SharePoint List Forms with Lightning Forms

In this video, we look at how to add an approval mechanism to an Expense Claim form. Expense Approvers can approve the expense claim by clicking a button, which in turn sets the Approval field to ‘Approved’, Approved by to the current user, and the Approved Date to today’s date and time. The button is modified to only be enabled for members of an expense approvers group.

Date function used within this demonstration:

The following Javascript was used to set the current date behind an action button within the Approved Date field:

return new Date();

below are a few more date examples that could be used within Lightning Forms:

= new Date()Set the current date time (can also be done just by using SharePoint default column value available in column’s configuration)
= new Date(2014, 5, 3)Set the date to 3rd June 2014. Note: The month (2nd) parameter is 0-based, so January is 0 and December is 11.
= new Date().addDays(10)Set the date to current date (and time) plus 10 days. Use addDays(-n) to subtract n days.
= new Date().addHours(4)Set the date to 2 hours in future.
= new Date().addYears(-1)Set the date a year ago from today.

Related Posts

Leave a comment