Applies to: Crow Canyon NITRO activated sites in:
SharePoint Online and On-Premises 2013/2016/2019/SharePoint Server Subscription Edition
Description
This article describes the process for logging email Id of the user who accesses a list item through NITRO display or edit form.
The configuration involves creating a Form Event Action (FEA) that triggers when the display or edit form loads. This action records the user’s email ID in a secondary list.
This secondary list is monitored by a NITRO Workflow that is configured based on ‘an item is created’ event and includes a ‘Send Mail’ action to notify the recipient about users who have viewed the list item.
List schema
- ‘Requests’: Custom SharePoint list
- ‘Requests’ list items are tracked in this example.
- Create ‘Request Logs’ custom SharePoint list
- Navigate to the Site -> Site contents -> New -> List and create a new list titled ‘Request Logs’.
- Create columns in ‘Request Logs’ list as per the below details:
Column Display Name | Column Internal Name | Column Type |
Title | Title | Single line of text |
Email Address | EmailAddress | Single line of text |
Related Ticket ID | RelatedTicketID | Lookup |
- ‘Related Ticket ID’ column settings:
Detailed steps
- Configure a form event action on the Requests list.
- Navigate to Requests list -> List Settings -> Permissions and Management -> Crow Canyon NITRO Forms.
- On the NITRO Forms designer page, expand the ‘Advanced’ section from the left-hand panel -> ‘Form Event Actions’ -> ‘New Configuration’ as shown below:

- Configure a form event action on form load as shown below:

- Configure ‘Execute Script’ action. Click ‘New Action’ -> Select ‘Execute Script’ action -> Specify custom JavaScript as shown below:
Script:
var ccsSPContext = _ccs_FormUI.SPUtils.Context;
if(ccsSPContext != null && ccsSPContext)
{
var LogsList = ccsSPContext.get_web().get_lists().getByTitle("Name_Of_the_logs_list");
var oListItemCreationInformation = new SP.ListItemCreationInformation();
var oListItem = LogsList.addItem(oListItemCreationInformation);
var useremail = _spPageContextInfo.userEmail;
var itemId = _ccs_FormUI.listItem.get_id();
oListItem.set_item('Title', 'Accessed List Item');
oListItem.set_item('EmailAddress', useremail);
oListItem.set_item('RelatedTicketID', itemId);
oListItem.update();
ccsSPContext.load(oListItem);
ccsSPContext.executeQueryAsync(function(){
window.ccs_g_FormUI.SetVariableValuebyName("varApproverLogItemId",oListItem.get_id())
functionCallback();
}, function(){
console.log('Failed' + args.get_message() + '\n' + args.get_stackTrace());
window.alert("Something went wrong. Please refersh the form before entering the data.");
functionCallback();
});
}


- Save the form event action and publish the NITRO Forms.
Configure a NITRO Workflow on ‘Request Logs’ list.
- Navigate to the ‘Request Logs’ list -> List settings -> Permissions and Management -> Crow Canyon NITRO Workflow -> Configure a NITRO Workflow based on ‘an item is added’ event as shown below:

- Click ‘Settings’ button from the ‘WORKFLOW’ ribbon and configure as shown below:


- Expand the ‘Actions’ section and add a ‘Send Mail’ action to the workflow as shown below:

- Configure the ‘Send Mail’ action as shown below:

- Sample mail template:

- Publish the NITRO Workflow.
Sample output
Navigate to the ‘Requests’ list (list from which the information needs to be tracked) and view or edit an item using NITRO Forms. This will create an entry in the ‘Request Logs’ list using the form event action. Once this entry is created, workflow will send an email to the designated user.
- An entry gets created in the ‘Request Logs’ list when an item is accessed through NITRO display form by a user:

- Sample email received:
