0

i created two workflows for the same list. The first workflow starts automatically when creating an item, and the second workflow starts when editing an item, so i want to create an item from the 2nd workflow. Now when I update any item, the second workflow starts and creates a new item in the list. But The first workflow didn't work.

How can the first workflow start in this situation?

3

The System Account is not allowed to start a workflow. When you create a new list item using a workflow, that new item is created by the System Account. So on any new item created by a workflow, "Start workflow on create" will not work. The workaround is to put "Create new item" inside an impersonation step in the second workflow. This will create the new item under the name of the person who publishes the workflow, and the first workflow will start on the newly created item.

I also like to create a new service account, in Central Admin, and publish the workflow from that account, rather than having items look like they were created by me when they were actually created by a workflow.

  1. Place your cursor outside of any steps, then click Impersonation Step in the ribbon.
  2. Insert action "Create list item"
  3. Click on "Current List" to specific field values for the new item.

enter image description here

  • i don't Know how to put this action inside an impersonation step !! hope to help me to do that . with thanks Miss.Erin L – Taher Esmail Mar 22 '16 at 19:33
  • In 2010, you create an impersonation step the same way you create a normal step. Insert the cursor before or after an existing step, and click Impersonation Step in the ribbon. In 2013, you have to create an app step and run with elevated permissions: qdoscc.com/blog/…. Google how to do that. – Erin L Mar 22 '16 at 19:36
  • Yeah i am Using Sharepoint designer 2013 and i Activated the Feature of " workflow app permissoins " but the App Steg in the ribbon didn't enabled in sp desgner – Taher Esmail Mar 22 '16 at 19:41
  • I forgot that in 2013 you can write 2010 workflows. You can use impersonation step if you create a 2010 workflow instead of 2013. – Erin L Mar 23 '16 at 15:37
  • yeah i can write 2010 workflows but i have loop in workflow that run when creating an item , so i cant do loop in 2010 . – Taher Esmail Mar 23 '16 at 19:52
0

Three options;

  1. Use 2010 workflows instead of 2013 if the activities you need included in 2010. This is a limitation that applies only to 2013 workflows.

  2. Make Create Workflow a 2010 workflow and Change workflow a 2013 workflow and start Create workflow from within Change workflow when required.

  3. I think the most elegant solution is to replicate (if practical) Create related activities within Change workflow. When you create the new item, it returns a Created variable allowing you to do pretty much anything you like on the newly created item.

Bit of a balancing act, depending what workflows do, how long they are etc.

  • I'm in 2010 and this limitation absolutely does apply to 2010. – Erin L Mar 22 '16 at 19:33
  • Strange, I just tested this again, I am using SP Online, maybe something is different. Two workflows, one on Create, one on Change. Change has one activity to create a new item in the same list. Create just logs something to the log. Both does not use impersonation. When I make a change on one list item, a new item gets created and the new item's create workflow is executed. This scenario works when I use 2010 workflows and doesn't if I use 2013 ones. – Charles Mar 22 '16 at 20:20
  • i have to create an app step and run with elevated permissions , but also the First Workflow didn't kicked off . Why ? – Taher Esmail Mar 22 '16 at 20:56
  • What platform are you on Taher ? 2010, 2013, Online ? – Charles Mar 22 '16 at 21:45
  • sharepoint server 2013 and within sharepoint designer 2013 – Taher Esmail Mar 23 '16 at 7:02

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.