locked
Data Change Captured in an email. RRS feed

  • Question

  • I have a list item where employees in my company maintain their contact information like addresses, phone numbers and emergency contact details and things like that.  I created a workflow in SharePoint Designer that sends out a notification to the team lead with the email content that prints the 'title' and the 'modified by' when a list item is modified or a new one is created. Now, I was hoping if someone can tell me if there's a way to capture which field is changed(while editing) and how to pass that on to the email content. 

     

    Thanks

     

     

    Thursday, May 19, 2011 9:54 PM

Answers

  • How many fields do you have?

    Of course,  you could set up an alert for the team lead so when the item is changed, the team lead would get an email and the alert shows what was changed.

    On the other hand, if you wanted something custom, a really dirty way to do it would be to create a "check" column (that is hidden) to store the value of a field so the workflow would compare the two fields when the item is modified.

    I did this once, but only compared a handful of fields. In a nutshell, here's what I did:

    I had a "Phone Number" column and a "Phone Number Check" column. The "Phone Number Check" column is set to the value of the "Phone Number" column when the item is initially created. When that item is modified, the workflow compares the "Phone Number" column to the value in the "Phone Number Check" column. If they are not equal, I set a dynamic string variable to "Phone Number" followed by a carriage return. I don't use a regular variable simply because if a regular variable is empty, it will display as "????" in my email - and I don't want that. Plus a dynamic string variable will allow a carriage return, which I'll use to list the fields that changed on separate lines in the email. 

    The following steps in my workflow follow the same process to compare the other columns I want to check.

    The final step in my workflow sends out an email that includes lookups to the dynamic variables I created. If the values changed, the names of those fields appear in the email. After the email is sent, I update the "check" columns with the current values of the columns I'm comparing.

    I hope this helps.


    Planet Technologies || SharePoint Task Force
    • Marked as answer by Deepayan Friday, May 20, 2011 5:24 PM
    • Unmarked as answer by Deepayan Friday, May 20, 2011 5:24 PM
    • Marked as answer by Deepayan Friday, May 20, 2011 5:25 PM
    Friday, May 20, 2011 7:07 AM

All replies

  • How many fields do you have?

    Of course,  you could set up an alert for the team lead so when the item is changed, the team lead would get an email and the alert shows what was changed.

    On the other hand, if you wanted something custom, a really dirty way to do it would be to create a "check" column (that is hidden) to store the value of a field so the workflow would compare the two fields when the item is modified.

    I did this once, but only compared a handful of fields. In a nutshell, here's what I did:

    I had a "Phone Number" column and a "Phone Number Check" column. The "Phone Number Check" column is set to the value of the "Phone Number" column when the item is initially created. When that item is modified, the workflow compares the "Phone Number" column to the value in the "Phone Number Check" column. If they are not equal, I set a dynamic string variable to "Phone Number" followed by a carriage return. I don't use a regular variable simply because if a regular variable is empty, it will display as "????" in my email - and I don't want that. Plus a dynamic string variable will allow a carriage return, which I'll use to list the fields that changed on separate lines in the email. 

    The following steps in my workflow follow the same process to compare the other columns I want to check.

    The final step in my workflow sends out an email that includes lookups to the dynamic variables I created. If the values changed, the names of those fields appear in the email. After the email is sent, I update the "check" columns with the current values of the columns I'm comparing.

    I hope this helps.


    Planet Technologies || SharePoint Task Force
    • Marked as answer by Deepayan Friday, May 20, 2011 5:24 PM
    • Unmarked as answer by Deepayan Friday, May 20, 2011 5:24 PM
    • Marked as answer by Deepayan Friday, May 20, 2011 5:25 PM
    Friday, May 20, 2011 7:07 AM
  • thanks appreciate your help on this!!!
    Friday, May 20, 2011 5:25 PM