locked
Workflow Looping RRS feed

  • Question

  • Hello

    I am having trouble creating a workflow that will accomplish a somewhat easy task. My problem is that I am Creating a 2nd list off of my first list and I want to be able to edit the 1st list and see the changes in the second list without duplicates.

    So I created a separate ID called "Savings ID" to relate to the 1st Lists ID field. When an Item is created in the 1st list, it will then start a workflow and create 3 new items in the 2nd list.

    Now my problem is that when the user Edits the item in the 1st list, it just creates 3 new Items in the 2nd list, but I need it to just update the 3 previous items based off of ID.

    Any Suggestions?

    Thanks

    Brandon

    Monday, June 18, 2012 2:31 PM

Answers

  • Hi Blnigro,

    I'm afraid that the SharePoint Designer Workflow does not support Looping. You may develop custom action to perform looping operation.

    In you case, what if you just add 3 action that delete item by the Savings ID. The 2 other items may be deleted.

    Hope that helps.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    Tuesday, June 19, 2012 7:22 AM
  • I think that rather than delete an existing record, you just update it.  So, your WF will look to see if the ParentID exists in the child list.  If yes, then update the three records, else append the 3 records.  It's not pretty nor manageble, but it gets the job done.

    Else, you're going to have to figure out how to keep triggering a WF until all are deleted, and then start appending.  This is a pain if you don't have CodePlex SPD Utilities (http://spdactivities.codeplex.com/) installed, which provides the 'Start Another Workflow' action. You'd have to have a control list and control fields to maintain the current state between instances of the WF triggering.  Not fun. (SharePoint Designer 2007 does not include this, but it may be in 2010.)


    Steve Clark, MCTS | Twin-Soft.com


    Tuesday, June 19, 2012 12:41 PM

All replies

  • I guess you need to check to see if the ID already exists in the "child" list, then update, rather than append. (I assume you're using the "Parent" list ID as the linking field.)


    Steve Clark, MCTS | Twin-Soft.com

    Monday, June 18, 2012 2:33 PM
  • Thanks for the response

    Yes I am using the ID Field in the first list and I created a Savings ID in the 2nd list so I can have 3 items with the same ID.

    And I also did the statement "IF List1:ID equals List2:Savings ID then Delete item in list2." Well it only deletes the 1st item and I am stuck with the 2 other items.

    Thanks
    Brandon

    Monday, June 18, 2012 2:46 PM
  • Hi Blnigro,

    I'm afraid that the SharePoint Designer Workflow does not support Looping. You may develop custom action to perform looping operation.

    In you case, what if you just add 3 action that delete item by the Savings ID. The 2 other items may be deleted.

    Hope that helps.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    Tuesday, June 19, 2012 7:22 AM
  • I think that rather than delete an existing record, you just update it.  So, your WF will look to see if the ParentID exists in the child list.  If yes, then update the three records, else append the 3 records.  It's not pretty nor manageble, but it gets the job done.

    Else, you're going to have to figure out how to keep triggering a WF until all are deleted, and then start appending.  This is a pain if you don't have CodePlex SPD Utilities (http://spdactivities.codeplex.com/) installed, which provides the 'Start Another Workflow' action. You'd have to have a control list and control fields to maintain the current state between instances of the WF triggering.  Not fun. (SharePoint Designer 2007 does not include this, but it may be in 2010.)


    Steve Clark, MCTS | Twin-Soft.com


    Tuesday, June 19, 2012 12:41 PM