locked
How to send an email only when the value in a field changes RRS feed

  • Question

  • Hello,

    I am using SharePoint 2007.

    I created a workflow using SharePoint Designer 2007. It was supposed to send an email only when the status of an item in a list is changed to "Completed", not every time the item is changed. However, the workflow ended up in a loop and dozens of emails were sent.

    I read that to prevent this, you can create a hidden column in a list and have the workflow check the value in the hidden field before sending the email. How do you create a hidden column in a list? I don't see that option when I try to create a field in a list.

    I also tried to customize the workflow so that if would check to see if the workflow had already been completed before sending the email. However, that didn't work because multiple versions of the workflow kept getting created. How do you prevent multiple versions of a workflow from being created? I already disabled allow versioning in SharePoint Designer 2007, but that didn't work.

    Thanks in advance.

    • Moved by Mike Walsh FIN Saturday, April 9, 2011 7:11 AM All pre-2010 workflow questions go to the workflow forum. Even those using SPD 2007 or VS. (From:SharePoint - Design and Customization (pre-SharePoint 2010))
    Saturday, April 9, 2011 3:06 AM

Answers

  • In order to create your hidden column, create the column. Then go into List Settings > Advanced Settings. Check "Yes" for "Allow management of content sites". Click OK to return to List Settings. You should see a section called "Content Types". Click the content type (probably called "Item"). Now click the column you created. In the column settings section, select "Hidden (Will not appear in forms)". 
    Planet Technologies || SharePoint Task Force
    • Marked as answer by Amatullah Saturday, April 23, 2011 10:12 PM
    Saturday, April 9, 2011 4:19 AM
  • To stop it looping, add a step in the very begining of the wf to check Condition

     if "Status" = "Complete" then "Stop Workflow". (This should be the first condition.)

    Then Check another condition

    if "Status" != "Complete" then "Send Email " 

     

    Always remember to stop wf on item changed event when a condition is met.


    Dare to promise
    • Marked as answer by Peng Lei Monday, April 18, 2011 7:13 AM
    Monday, April 11, 2011 4:00 PM

All replies

  • In order to create your hidden column, create the column. Then go into List Settings > Advanced Settings. Check "Yes" for "Allow management of content sites". Click OK to return to List Settings. You should see a section called "Content Types". Click the content type (probably called "Item"). Now click the column you created. In the column settings section, select "Hidden (Will not appear in forms)". 
    Planet Technologies || SharePoint Task Force
    • Marked as answer by Amatullah Saturday, April 23, 2011 10:12 PM
    Saturday, April 9, 2011 4:19 AM
  • You can also handle this by writing a little event-handler over that list on update status change. check the value of field if its "Complete", if yes then pop out the email.
    Saturday, April 9, 2011 6:23 AM
  • To stop it looping, add a step in the very begining of the wf to check Condition

     if "Status" = "Complete" then "Stop Workflow". (This should be the first condition.)

    Then Check another condition

    if "Status" != "Complete" then "Send Email " 

     

    Always remember to stop wf on item changed event when a condition is met.


    Dare to promise
    • Marked as answer by Peng Lei Monday, April 18, 2011 7:13 AM
    Monday, April 11, 2011 4:00 PM
  • Hi,

    You can only use the second condition out of the two conditions mentioned by Deepak. That is, if "Status" != "Complete" then "Send Email". You can make this work by ignoring the first condition.

    Regards

    Ginni - Microsoft Community Contributor

    [My SharePoint Blog]

    Monday, April 11, 2011 6:49 PM
  • Thanks Roland.

    That worked perfectly.

    • Edited by Mike Walsh FIN Sunday, April 24, 2011 7:00 AM New question removed. You have said that the solution here worked and have marked two posts as answers. Post your new question as a new thread
    Saturday, April 23, 2011 10:20 PM