0

Need Workflow to run only when a specific item is created or changed (Pause/Date-time workflow) My workflow currently runs when any item is changed or created I need it to only run when the item is changed or created; when the Status field is changed to pending.
Here is what I have so far:

enter image description here

enter image description here

  • When you say "Specific item" do you mean a single file that currently exists and/or that you will be creating/uploading? Or do you mean run the workflow on any item when the status is pending? – vanblart Mar 26 '18 at 18:39
  • the workflow on any item when the status is pending – vier111 Mar 26 '18 at 19:36
  • Ok, and what would you like to accomplish with the workflow? The actions shown in your screenshot? – vanblart Mar 26 '18 at 19:44
  • Basically, if the current item Status (drop down menu) field is changed or created to "pending" (one of the options in the drop down field) an email is sent out 63 days from the date in the start date field. – vier111 Mar 26 '18 at 20:05
  • Ok, that makes sense. I outlined how to resolve the issue below :) Comment there if you're still not getting what you want! – vanblart Mar 26 '18 at 20:26
2

Based on the conversation above (See comments), you are very close to having what you want. However, currently you are checking if the task is in the "Pending" status. If it is, do nothing. Then wait 63 days and send an email (regardless of status). This is because your last 2 actions are not inside of the "If" statement.

To move them to the correct location, select one of them and press Ctrl + X on your Keyboard. Then, click just below the "(Start typing...)" message. You should see a small orange 'cursor' of sorts. Press Ctrl + V to paste the action to the new location. Repeat for the 2nd action.

Once you're done, it should look (roughly) like this: End goal

Once this is setup, I would recommend testing with an email sent to yourself and a pause of ~5 minutes or so to determine if it is working without waiting 63 days.

1
  1. If the change to Pending only occurs once, then create a workflow that starts on Created and the uses the "Wait for Field Change in Current Item" action.

  2. You could also create a workflow that loops and uses "Wait for Field Change in Current Item" inside of the loop.

  3. You could create a workflow that starts on Created or Changed, simply tests if Status equals Pending, and if not so, it just exits. If Status does equal pending, then it does the "Pending status" work.

I prefer the last option and it does not leave workflows running. It just starts and exits, or starts and does its work.

0

I can see a problem that I have already faced. This way, when you look at workflow history you are going to have several entries since the workflow have to start to check the status. If you are on prem, you can create an event receiver to check the condition and decide if the item should or should not start the workflow. If you are online, you can create a custom form webpart to check when to start a workflow for this item.

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.