3

I am trying to create a workflow in SharePoint designer 2013. I need to send email for 4 actions.

  1. When a new item is created
  2. When 'Assigned to' field is changed
  3. When 'Due date' is changed
  4. When status changed to Completed

How to create a single workflow to send email for these 4 actions?

  • Are you in 2013? – Erin L Jul 18 '16 at 18:30
3

Using workflow you will not be able to validate which field got changed. Workflow kick starts after update and the previous data will be out of context.

You best option is to use an Event Receiver.

2

This is easy to do in workflows. However, your probably want 3 separate workflows. The one that runs on create would send the original email, then Wait for Status to equal Completed, then send another email.

The other two would send alerts on changes in Assigned To and Due Date.

  1. Wait for Assigned To to not equal Assigned to, then send email.
  2. Wait for Due Date to not equal Due Date, then send email.

IF Assigned To and Due Date should only change once, you could put them in parallel inside the main workflow, but I wouldn't risk it.

  • If you have 2013 you could do this in one workflow, where the Wait for actions would be in a repeating loops. – Erin L Jul 18 '16 at 18:48
  • Interesting. I didn't think I could achieve the solution this easily. I'll try your way. Yes, I have 2013. if I create 3 separate workflows, what should I select for workflow 'Start Options' for all 3 workflows? Start workflow automatically when an item is created vs. an item is changed. – Joe Cutler Jul 18 '16 at 18:58
  • Start the first workflow when an item is created. It will send an email, then will send another email once Status = Completed. The others would be on item is changed. However, if you put loops in your main workflow in parallel with the other steps, you could build just one workflow. But honestly, it's more complicated that way and doesn't have any benefit over writing 3 separate workflows... especially since it sounds like you're new to workflows. – Erin L Jul 18 '16 at 19:01
  • 1
    Hey, Erin. Hope all is well. had a quick question. I am using SharePoint designer 2013 and I don't see the action 'to not equal'. Am I missing something? – Joe Cutler Jul 27 '16 at 23:18
  • 1
    Thanks @Erin Just found out that option was in SPD 2010, which they discontinued in SPD 2013. I have SPD 2013 and SharePoint environment, so seems like the simple solution you shared won't work :( – Joe Cutler Jul 28 '16 at 17:55
1

Here's an example of how you can accomplish this using hidden check fields which update via the workflow and make it so that that particular action only executes one time. You could also use the Wait for Field Change in Current Item action if the sequence of changes always happens in the same order (and you are using 2013). The below example is for checking just one field (status) and making sure the emails don't send more than once, but you can apply multiple check fields and logic to accomplish something similar with the due date and assigned to fields and do all of it in the same workflow. This also works well when working with 2007/2010.

enter image description here

  • 'not equals' isn't an option in SPD 2013. I am using SPD 2013 for SharePoint 2013 environment. Any workaround? – Joe Cutler Jul 28 '16 at 22:46
  • I think that depends on the field type (Status Check is a single line of text field). The workflow I included is a SPD 2013 workflow. That said, if not equals is not available you could just set the default field value to the "Status Check" field to a value and then check against that with equals, then set it to something else after the action. Once it runs it will set the value to something else (doesn't really matter what just something different) and next time it runs it'll no longer equal the default value and won't execute the action again. – Nate Aug 1 '16 at 14:15
1

I think this is possible to achieve without using event receivers. My approach is as follows:

  1. Create a new list column called 'Flag' which has the default value the same as whatever the initial value is for the column you want to check for changes.
  2. Create a SharePoint Designer 2010 Workflow
  3. First step is: if current item:value to check NOT EQUALS Flag
  4. Next step is to set up the email notification
  5. Next step is to set 'Flag' to the new value: Set Flag to current item:value to be checked
  6. Finally, add an Else statement that simply stops the workflow. This would only be fired if the first step (i.e. if current item:value to check NOT EQUALS Flag) is not true (i.e. current item:value EQUALS Flag)

This approach works well in my scenarios where I am only checking one field for change. When you are checking multiple fields for change it could get complicated, but would still be possible.

The use of flags in workflows to store what are essentially persistent variables can solve lots of problems I find. Sometimes you have to get quite imaginative though!

0

The simple solution without code is to use alerts to adjust it to send an email if the item added or changed, not as your condition specifically.

enter image description here

You can also use a workflow by running the workflow automatically on add and change by writing conditions to check the value of field and action to send the email for

  • When a new item is created.
  • When 'Assigned to' field is changed.
  • When 'Due date' is changed.
  • When status changed to Completed.

enter image description here

also, You can use Event receiver with the item was updated event as mentioned here to apply your business requirement as you need especially at the second and third option

  • Alerts is not an option because Business doesn't want that & Event receiver is not an option since I don't have Visual Studio. How do I write conditions to check the value of field and action? I tried the following solution - [link] (officepowerups.com/2013/07/09/…) - and it seems working for some people from the comments. However, it didn't work for me. – Joe Cutler Jul 18 '16 at 18:30
  • what's your problem in your reference article ? – Mohamed El-Qassas MVP Jul 18 '16 at 18:33
  • 1
    @DevoWorx If can't check what the previous value was to compare it to. It would work for Status = Complete, but not for changes in Assigned To and Due Date. – Erin L Jul 18 '16 at 19:02
  • 1
    you need to create a new column in your list and set it as previous value when item changed to check it with the current value else you should create event receiver before properties as before item added to check the previous value hope it helps you – Mohamed El-Qassas MVP Jul 18 '16 at 19:06
  • 1
    I used to do it that way, before I found out about the Wait for action. – Erin L Jul 18 '16 at 19:13
0

We use this technique all the time, the way Nate has it written. Only difference is we just test once

If currentitem:status is not equal to currentitem:status check
    if currentitem:status is equal to completed
        do stuff
   if currentitem:status is equal to work in progress
        do stuff
   then set currentitem:statuscheck to currentitem:status
0

As noted, person fields tend not to work well when doing the comparison "person" not equals "personcheck." The way around this is to include a step to translate both of these fields into string type workflow variables then compare the two variables. The workflow seems to handle this more reliably

  • This is not an answer. If you want to ask new question then use ask. If you want to suggest something then please add comment. – Ganesh Sanap Nov 5 '18 at 16:26
0

Hybrid solution perhaps - but i'm concatenating the fields that i'm getting the latest values and store them into 1 variable during the workflow and afterwards i'm updating a new field that holds this "after" value with this variable. Then just compare the two and change will be detected. Hope it helps

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.