Need Workflow to run only when a specific item is created or changed (Pause/Date-time workflow)

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/238600

  •  13-01-2021
  •  | 
  •  

سؤال

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

هل كانت مفيدة؟

المحلول

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. 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.

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top