none
Workflow create list item using lookup column with multi value

    Question

  • I'm trying to build an workflow on SharePoint Designer, I've SharePoint server 2010
    when item is created from "List A" workflow automatically Started and create new item in "List B". 
    On "List A" exist one lookup field with multiple values (Almost 50 values)(Its name is Software). I want when workflow run, create items on "List B" based on number of value in "List A" lookup field. 

    Here's what I need to happen:

    List A:

    • Title: Name1       Software: CRM, Word, Excel

    List B:

    • Title: Name1      Software: CRM
    • Title: Name1      Software: Word
    • Title: Name1      Software: Excel

    when workflow run create 3 item in List B.
    I'll try to explain this the best I can in words, Is possible to make this using only SharePoint designer??
    Thanks in advance.


    • Edited by LB-softcom Wednesday, August 14, 2013 5:04 AM b
    Tuesday, August 13, 2013 1:21 PM

Answers

  • Hi LB,

    You can't create loops in SharePoint 2010 designer workflows straight away.

    So if you don't know how many items are going to be there in your item in List A, you won't be able to fetch them all.

    The dirty way through SPD could be possible that fetch all the values using sub string method in 50 different variables in your workflow and then put 50 conditions (as you mentioned there could be 50 items) if the variable is not null or not empty create a new item in your list B with the current value and if variable is null or empty skip all the proceeding statements and finish the workflow.

    But as I said this is the dirtiest way to do this if you want to do it through SPD and if the look up values increases from 50 to 51 or more you have to update your workflow to handle the new values.


    #RoHsTr

    • Marked as answer by LB-softcom Saturday, August 17, 2013 7:56 AM
    Wednesday, August 14, 2013 6:02 AM

All replies

  • Hi,

    Base on the description, you want to create Workflow to add list item using lookup column with multi value.

    We need to create a Visual Studio workflow for your requirement since we can't count how many software are there in the lookup field using the OOB actions in SharePoint Designer workflow.

    Following is a reference about creating a VS workflow.
    http://msdn.microsoft.com/en-us/library/gg265727.aspx


    Best Regards,

    Linda Li

    Wednesday, August 14, 2013 5:16 AM
  • Hi LB,

    You can't create loops in SharePoint 2010 designer workflows straight away.

    So if you don't know how many items are going to be there in your item in List A, you won't be able to fetch them all.

    The dirty way through SPD could be possible that fetch all the values using sub string method in 50 different variables in your workflow and then put 50 conditions (as you mentioned there could be 50 items) if the variable is not null or not empty create a new item in your list B with the current value and if variable is null or empty skip all the proceeding statements and finish the workflow.

    But as I said this is the dirtiest way to do this if you want to do it through SPD and if the look up values increases from 50 to 51 or more you have to update your workflow to handle the new values.


    #RoHsTr

    • Marked as answer by LB-softcom Saturday, August 17, 2013 7:56 AM
    Wednesday, August 14, 2013 6:02 AM