locked
Update an Item and workflow checks in item data as new item RRS feed

  • Question

  • I am working with SPD 2007 and am trying to take item info from one list and move it to another list under certain conditions. When I try to create (or copy) an item from one list to another, it works when I update an item in list one, and transfers to list 2. However, if I go back in and try to update the same item again, the workflow runs again, and instead of adding the item info to the existing item in list 2, the workflow creates a completely new item in list 2 (which causes absolutely unecessary repetition and overlapping). Any suggestions??

    Wednesday, February 16, 2011 3:46 PM

Answers

  • Hey Bean224,

    I suspect this might be happening, in your workflow did you use the Create List item to do the initial copy in the second list?  If so then everytime the WF runs it will just create a new item. 

    To avoid this set a boolean value in the first list, something like FirstRun, and set it to Yes.  Then, in the workflow have this structure:

    • (Conditions) - If First Run equals No (Actions)  - Create List Item, Set First Run to No
    • (Conditions) Else, If First Run equals No (Actions) - Update List item

    I hope that helps!

    Tom


    Tom Molskow - SharePoint Architect - Microsoft Community Contributor 2011 Award - Linked-In - SharePoint Gypsy
    • Marked as answer by Bean224 Wednesday, February 23, 2011 5:46 PM
    Thursday, February 17, 2011 10:10 PM

All replies

  • Hey Bean224,

    I suspect this might be happening, in your workflow did you use the Create List item to do the initial copy in the second list?  If so then everytime the WF runs it will just create a new item. 

    To avoid this set a boolean value in the first list, something like FirstRun, and set it to Yes.  Then, in the workflow have this structure:

    • (Conditions) - If First Run equals No (Actions)  - Create List Item, Set First Run to No
    • (Conditions) Else, If First Run equals No (Actions) - Update List item

    I hope that helps!

    Tom


    Tom Molskow - SharePoint Architect - Microsoft Community Contributor 2011 Award - Linked-In - SharePoint Gypsy
    • Marked as answer by Bean224 Wednesday, February 23, 2011 5:46 PM
    Thursday, February 17, 2011 10:10 PM
  • Hi Bean224,

    Yes, you can a column to judge whether to create list item or to update a list item.

    Or you could also create two workflows. One workflow set to start when a new item is created and another set to start when an item is modified. Use create list item in the first workflow and update list item in the second.

    A List1ID column could be created in list2 use to store the list1 ID. Copy list1 ID to List1ID field when create a list item (not copy list item action). When update the list2 item if list1 item is modified, List1ID could be used to find out which item in list2 is the target item (update list2 item when List1ID = current list ID).

    Let me know how it works, thanks.
    Emir

    Friday, February 18, 2011 3:18 AM
  • Thanks so much!! That worked perfectly! The answer was RIGHT in front of me. Outside perspective is a wonderful thing!

     

    Thanks again!

    Wednesday, February 23, 2011 5:47 PM