Detecting Changes

When sending a notification you may want to include the changes that occured to the employee in the email notification.

There are 4 different constants (each providing a different format) that store the employee changes that can be referenced in your expressions:

  1. Changes to Json
  2. Changes to CSV
  3. Changes to Text
  4. Changes to HTML

Any of these constants can be used when selecting a field and will appear within the Constants category.

Here is an example of referencing the ChangesToJson constant in the body of a notification. When the notification is sent, the body of the email notification will contain a JSON representation of the changes that occurred.

1. ChangesToJson

The ChangesToJson constant holds all the changes that occured to the employee record in a Json format and it can be referenced in your notification to send the changes as a Json string. 

{
"EmployeeId": "D9XF12340070",
"CompanyId": "A1B2C",
"EmployeeNumber": "001234",
"CompanyCode": "ABC",
"Action": "Update",
"Changes": [
{
"Mapping": "Job Title",
"Type": "Attribute",
"Name": "title",
"NewValue": "Manager",
"OldValue": "Cashier",
"WhenChanged": "2023-01-07T16:44:45.9853634-04:00"
},

{
"Mapping": "Department",
"Type": "Attribute",
"Name": "department",
"NewValue": "Marketing",
"OldValue": "Sales",
"WhenChanged": "2023-01-07T16:44:45.9853634-04:00"
}

]
}

2. ChangesToCSV

This ChangesToCSV constant holds all the changes that occured to the employee record in a CSV format and it can be referenced in your notification to send the changes as a comma-delimited string . 

"Employee ID","Company ID","Employee Number","Company Code","Action","Mapping","Type","Name","New Value","Old Value","When Changed"
"D9XF12340070","A1B2C","001234","ABC","Update","Department","Attribute","department","Marketing","Sales","4/19/2023 10:01:14 PM"
"DAXF99000071","A1B2C","007865","ABC","Update","Job Title","Attribute","title","Manager","Cashier","4/19/2023 10:01:14 PM"

 

3. ChangesToText

The ChangesToText constant holds all the changes that occured to the employee record in a HTML format and the constant can be referenced in your notification to send the changes as a Json string. 

Employee ID = D9XF12340070, Company ID = A1B2C, Employee Number = 001234, Company Code = ABC, Action = Update, Mapping = Department, Type = Attribute, Name = department, New Value = Marketing, Old Value = Sales, When Changed = 4/19/2023 10:08:46 PM
Employee ID = DAXF99000071, Company ID = A1B2C, Employee Number = 007865, Company Code = ABC, Action = Update, Mapping = Job Title, Type = Attribute, Name = title, New Value = Manager, Old Value = Cashier, When Changed = 4/19/2023 10:08:46 PM

 

4. ChangesToHTML

The ChangesToHTML constant holds all the changes that occured to the employee record in a HTML format and it can be referenced in your notification to send the changes as a Json string.

<div>
    <div>Employee ID</div>
    <div>D9XF12340070</div>
</div>
<div>
    <div>Company ID</div>
    <div>A1B2C</div>
</div>
<div>
    <div>Employee Number</div>
    <div>001234</div>
</div>
<div>
    <div>Company Code</div>
    <div>ABC</div>
</div>
<div>
    <div>Action</div>
    <div>Update</div>
</div>
<div>
    <div>Mapping</div>
    <div>Department</div>
</div>
<div>
    <div>Type</div>
    <div>Attribute</div>
</div>
<div>
    <div>Name</div>
    <div>department</div>
</div>
<div>
    <div>New Value</div>
    <div>Marketing</div>
</div>
<div>
    <div>Old Value</div>
    <div>Sales</div>
</div>
<div>
    <div>When Changed</div>
    <div>4/19/2023 10:12:59 PM</div>
</div>
</br>
<div>
    <div>Employee ID</div>
    <div>D9XF12340070</div>
</div>
<div>
    <div>Company ID</div>
    <div>A1B2C</div>
</div>
<div>
    <div>Employee Number</div>
    <div>001234</div>
</div>
<div>
    <div>Company Code</div>
    <div>ABC</div>
</div>
<div>
    <div>Action</div>
    <div>Update</div>
</div>
<div>
    <div>Mapping</div>
    <div>Job Title</div>
</div>
<div>
    <div>Type</div>
    <div>Attribute</div>
</div>
<div>
    <div>Name</div>
    <div>title</div>
</div>
<div>
    <div>New Value</div>
    <div>Manager</div>
</div>
<div>
    <div>Old Value</div>
    <div>Cashier</div>
</div>
<div>
    <div>When Changed</div>
    <div>4/19/2023 10:12:59 PM</div>
</div>

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.