none
Workflow - Create New List Item with lookup field RRS feed

  • Question

  • I have an 'Item list' that has 'ItemName' as a string. The Workflow creates a new 'Task' when a new Item is created. The 'Task' has 'Item Name' as a lookup to that 'Item list'.

    I want the Workflow to "Create New List Item" and fill in the 'ItemName' lookup (in Task) with the 'ItemName' string (in Item).

    The workflow won't do it because they are different 'types'. Is there a way around this?   

    Friday, October 29, 2010 6:23 PM

Answers

  • As clubok said, lookup fields are actually IDs even though you see a display name (only for end user purposes).  So, you need to pass the ID of the related item to this field, and you can do that like this:

    Create New List Item:

    ItemName = ID[CurrentItem:ItemName=ItemList:ItemName]

    Something like that - it basically uses a filtered lookup based off the text.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Friday, October 29, 2010 9:39 PM

All replies

  • The lookup field needs the ID of the item to which you are referring, not the name.  If you don't have the ID, you should be able to get it with a Workflow Lookup operation.
    • Marked as answer by Clayton Cobb Friday, October 29, 2010 9:30 PM
    • Unmarked as answer by Clayton Cobb Friday, October 29, 2010 9:39 PM
    • Proposed as answer by Clayton Cobb Friday, October 29, 2010 9:40 PM
    Friday, October 29, 2010 8:14 PM
  • As clubok said, lookup fields are actually IDs even though you see a display name (only for end user purposes).  So, you need to pass the ID of the related item to this field, and you can do that like this:

    Create New List Item:

    ItemName = ID[CurrentItem:ItemName=ItemList:ItemName]

    Something like that - it basically uses a filtered lookup based off the text.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Friday, October 29, 2010 9:39 PM