locked
Send email with column values before and after change with workflow RRS feed

  • Question

  • I am trying to send an email to specified users when a column in a list changes in MOSS 2007 with workflow. I have a comments column in a list and whenever any user updates that comment, a mail should go to the creator and specific group stating what has changed.
    I saw a response which states to create 2 lists and keep them in sync and compare values of comments from the two lists. But that is not a perfect solution.
    Please help. Thanks in advance.
    Thursday, November 3, 2011 5:01 AM

Answers

  • Hi,

    If we want to compare a column with itself, we need the help of another column. We can create a column in the same list named Comment2 for example, and it’s the backup copy of comments.

    The workflow conditions can be set that if comments not equal Comment2, in Actions set send an email (we can get the previous value in Comment2 and new value in comments), and then update the Comment2 to comments.

    Thanks,
    Emir

    • Marked as answer by Emir Liu Monday, November 14, 2011 2:18 AM
    Monday, November 7, 2011 7:10 AM

All replies

  • Hi SharePointGuy,

    You don't need 2 lists to do this. Here's what you do:

    -Go into SharePoint Designer and create a workflow that is attached to whatever list houses the comments column

    - Select 'Automatically start this workflow whenever an item is changed'

    - Under conditions select 'Compare [whatever] field' and set the conditions (generally if comments is not empty or something like that)

    - Under Actions select 'Send an Email' and fill in your options

    Finish it and that should work fine.

    Thursday, November 3, 2011 9:30 PM
  • I get what you mean. I only need to know the conditions we need to set. When a comment already exists and is changed, we cannot put the condition for comparison for blank. We need to check the existing and new version of comment field. I know that is also possible. But need to know how. I referred this reply which helped but not fully.

    http://stackoverflow.com/questions/5540076/can-you-check-the-field-in-current-workflow-tasks-list-and-also-check-a-field-in

    Any help would be appreciated.

    Friday, November 4, 2011 3:45 AM
  • Hi,

    If we want to compare a column with itself, we need the help of another column. We can create a column in the same list named Comment2 for example, and it’s the backup copy of comments.

    The workflow conditions can be set that if comments not equal Comment2, in Actions set send an email (we can get the previous value in Comment2 and new value in comments), and then update the Comment2 to comments.

    Thanks,
    Emir

    • Marked as answer by Emir Liu Monday, November 14, 2011 2:18 AM
    Monday, November 7, 2011 7:10 AM
  • @Emit I already tried this option and is not a feasible one.
    Tuesday, November 8, 2011 8:26 AM
  • Hi SharePointGuy,

    I’ve tried Emir’s solution and it works. Is it possible that something missed when you created workflow?

    Thanks,
    Hellen


    Come on!
    Wednesday, November 9, 2011 9:48 AM
  • Hi SharePointGuy,

    1, We can use a workflow start only when a new item is created, and use it copy Comment to Comment2.
    2, Create second workflow start only when item ise modified, and set the compare condition and send email action there.

    And when you test the workflows, please test them from the beginning (create a new item and let the first workflow start automatically) and don't start the workflow on a existing item manually.

    Best regards,
    Emir


    • Edited by Emir Liu Wednesday, November 9, 2011 10:47 AM
    Wednesday, November 9, 2011 10:44 AM
  • Hi,

    Thanks! but its work only for the single line or multiline field. If i want to send the email when any value change from selection (i.e. drop down list), it creates the problem.

    I have tried it by doing as:

    1. Let us assume our selection field name is Status then,

    2. create new column named Tracker.

    3. create workflow for the list and set conditions as:

     a) If Status != Tracker

         and if Status = any particular value from list

         Send an Email

         then set Tracker = Status

    b) If Status = Tracker

       Stop Workflow.

     c) If Status != Tracker

       Set Tracker = Status

    Then OK.

    But its not working properly. Can you please let me suggest any good way to do this?

    Thursday, October 10, 2013 9:35 AM
  • Hi,

    Here's one more solution that I have tried out myself and found that it works well:

    1. Have a column called "Send Email" - which has 3 options: Yes/No/Sent

    2. While creating a new entry, the default value can be set as "Yes", which indicates that a email notification has to be sent. 

    3. Make the workflow run every time an item is modified.

    4. When the workflow runs, Check if the "Send Email" column is "Yes" and make it send the email. Then, update the value to "Sent"

    To trigger an email on changing the Status, you can manually set the "Send Email" column to "Yes" and it would do the rest.

    Tuesday, August 5, 2014 4:31 PM