How to create multiple list items based on selections from a list lookup?

  • 17 December 2015
  • 4 replies
  • 8 views

Badge +4

I am struggling a bit to make this idea work...

 

Business scenario:

I have a client who would like to create tasks when a new security vulnerability is identified.  Each platform that is in scope would have a list item to track the status, resource, and details about the effort.

 

My approach so far:

I have a "Platforms" list and then a "Vulnerabilities" list for each item with columns for the SME assigned, status, as well as a lookup column to the "Platforms" list.  My thought was that the "Vulnerabilities" list would have a workflow with a Nintex start form that would allow the submitter to enter a title and select the platforms in scope.  Then the workflow would create an item for each in scope platform selected.  I created the start form with a list lookup control pulling from the "Platforms" list.

BGWorkflowStartForm.png

I am not figuring out how to correctly capture the platforms selected in the workflow start form to use when creating items in the list.  I assumed they would have to be saved to a collection workflow variable in order for the workflow to loop through them and create the items, but I don't know how to get it to save to a collection. 

 

Any guidance on this would be much appreciated.

Thank you!

Brian


4 replies

Badge +4

I am also attempting this with a second "intake list", which is just a Title and the Platforms lookup field. 

I have a regular expression splitting the selection from the platforms lookup column, "Platform", using pattern ";" and storing in a Collection variable called "Selected Platforms".

For each "Selected Platforms" save to "Current Platform" single line of text variable... I also tried multi line.

Create item in the tracking list using the Title and Current Platform.

This errors out:

Coercion Failed: Unable to transform the input lookup data into the requested type.

bgworkflow.png

I think I like this approach more, but I am not getting it to work

Badge +11

Hi Brian,

Your approach is correct. The error could be because the lookup column stores the ID of the corresponding value and not the value itself. You can check this by writing the output of the Regular expression to workflow status.

If this is true, then you have to get the value of the corresponding platform before you create the For Each loop. Hope that helps.

Badge +4

That makes sense based on the error I am seeing.  The output data appears to be ok, but maybe it is not... Here is the log from both the multi-select lookup column and then then the collection variable right after the regular expression.

bgworkflow2.png

I also tried to set a multi line of text variable to equal the lookup values and then do the regular expression on the MLoT, but that had the same result.  Any other thoughts are welcome.

Thanks!

Badge +4

Ok, I finally got this working correctly by using this approach.  The person using the list submits a new vulnerability using the intake list.  The Platforms list contains all of the possible platforms and the subject matter expert (SME).  The workflow on the intake list creates an item in the tracker list for each platform in scope and assigns it to the default SME.

 

Platforms list - columns: Title and SME (people picker)

Intake list - columns: Title and Platform (lookup column - included ID as additional column)

Vulnerability Tracker list - columns: Title, Platform (lookup), and SME (lookup).  Also, there are other columns that are manually edited later in the process.

     nintex1.png

     Workflow variables

     nintex2.png

     Workflow

     nintex3.png

Configuration for the Create Item.  This is where all the problems were occurring even though it would show the error was in the For Each action.

     nintex4.png

"Platform" is the lookup column in the destination list and I was trying to pass text to it which was causing my issues.  I thought it would want to receive the name of the platform, but it needs the ID which I have as an integer type.  This works exactly how I need it to now.  Hope this helps someone else if you are trying to use lookup columns in your workflows.

Reply