locked
Updating a list item with a work flow: list items not matching RRS feed

  • Question

  • Hi

    I have a general list and a calendar list. When I create a new item in the general list, a workflow runs which creates a new item in the calendar and copies some of the column values from the general to the calendar list (screenshots below). One of the fields it copies is the ID from the first, general list to a column in the calendar list. This all works fine.

    I am trying to add to this workflow by creating a second step that operates when an existing item is modified in the first, general list, it looks for the same item in the calendar list by using the ID field written to the calendar when it was first created and updates the calendar list item accordingly. The problem is that it is not updating the existing item in the calendar, but creating a new one. The workflow step is definitely a 'update item' and as I said, the ID is being properly written to the calendar. The other issue is that in the workflow, when I save it, I get an error saying that the the 'the lookup field you defined is not guaranteed to return a single value....' However, since it is an ID field, it has to.

    Has anyone run into this before?

    Paul



    • Edited by Paul-NYS Thursday, August 2, 2012 3:33 PM
    Thursday, August 2, 2012 2:11 PM

Answers

  • Hi Paul,

    I think the easiest way is create two workflow for this list.

    One is triggered when item created, and another is triggered when item is edited.

    Thanks


    Pengyu Zhao

    TechNet Community Support

    • Marked as answer by Pengyu Zhao Thursday, August 9, 2012 8:41 AM
    Monday, August 6, 2012 9:21 AM
  • Hi, Paul some of the People Just use if Created = Modified for New item and Created != Modified for item that is updated.

    In addition to this, In your screenshot the 2nd screenshot specifically say that you are looking up to the Training ID (do not use). For me you should just use the ID (OOB ID field). and the Value should be the One that is equivalen to Training ID Just click the ... select Current item Training ID.

    • Edited by Ranjoe Monday, August 6, 2012 6:55 PM
    • Marked as answer by Pengyu Zhao Thursday, August 9, 2012 8:41 AM
    Monday, August 6, 2012 6:51 PM

All replies

  • Hi Paul,

    I think there is some problem in the process of this workflow.

    If I create an item in the general list, then I modify this item immediately, because the created is still equal to today, so the workflow would create a new item in calendar list.

    And for the error you got, it’s just a warning. If you make sure it could return a single value, you can just ignore this.

    Thanks


    Pengyu Zhao

    TechNet Community Support

    Friday, August 3, 2012 6:54 AM
  • For the workflow to determine whether to create a new record in the second, calendar list vs. finding and editing an existing record, what is the best way to identify an existing record that is being modified vs. adding a new record?

    Paul

    Friday, August 3, 2012 10:41 AM
  • Hi Paul,

    I think the easiest way is create two workflow for this list.

    One is triggered when item created, and another is triggered when item is edited.

    Thanks


    Pengyu Zhao

    TechNet Community Support

    • Marked as answer by Pengyu Zhao Thursday, August 9, 2012 8:41 AM
    Monday, August 6, 2012 9:21 AM
  • Hi, Paul some of the People Just use if Created = Modified for New item and Created != Modified for item that is updated.

    In addition to this, In your screenshot the 2nd screenshot specifically say that you are looking up to the Training ID (do not use). For me you should just use the ID (OOB ID field). and the Value should be the One that is equivalen to Training ID Just click the ... select Current item Training ID.

    • Edited by Ranjoe Monday, August 6, 2012 6:55 PM
    • Marked as answer by Pengyu Zhao Thursday, August 9, 2012 8:41 AM
    Monday, August 6, 2012 6:51 PM