cancel
Showing results for 
Search instead for 
Did you mean: 
klmerrills
Nintex Newbie

Workflow to pull items from two lists with looping and email notification

Jump to solution

Looking for some assistance with creating a workflow that pulls data from List A and pulls looped though data from List B, then combines the data in an email notification. We are using SharePoint 2016 on premise.

 

Currently this is a workflow created on List A

 

List A - Supply Request:

This is the parent list. Only one parent per request

Columns: Item, Vendor, Total Cost, ID (list created ID), etc...

 

List B – Expense Items

Columns: Expense Type, Quantity, SRID (SRID is linked to the List ID in the Lisa A – Supply Request), etc...

Each parent request from List A, can have multiple child records from List B.

 

Using just Lisa A: my problem is when I try to pull the child records from list B, no results are included in the email notification.

 

Here is my current workflow for List A:

            Query List A and place each option into a collection.

           Image1.PNG

 

            Query List B and place each option into a collection

           Image2.PNG

            Build eMail string

           Image3.PNG

            For Each…

           Image4.PNG

            Run parallel actions… Collection Operation. A collection Operation was created for each Field in the Query List actions. This is just one of the Collection Operations…

    Image5.PNG       

            Build String.

           Image6.PNG

            Math Operation (used for looping)

           Image7.PNG

          Build string.

          Image8.PNG

            eMail Notification

           Image9.PNG

 

Any suggestions are greatly appreciated?

 

Thanks

Krysta

Labels: (1)
0 Kudos
Reply
2 Replies
Automation Master
Automation Master

Re: Workflow to pull items from two lists with looping and email notification

Jump to solution

@klmerrills ...It seems the variable you're using to filter List B is a collection. Try below approach:

 

  1. Query your list A and get all the fields you need (including ID column) and store it in respective collections
  2. Using For each loop, index and collec_ID_List_A (store it in int variable)
    1. Inside for loop, using Run Parallel action, collection operation and index variable, get individual values and store it in respective type of variables
    2. Add commit pending changes
    3. Using query your list B and filter it "SP ID = int_Each_ID_List_A" (and not collection variable)
      1. Do the same thing you did for list A and store it in respective type of variables
      2. Using all these variables, build your table. In build string you also need to add the variable where you're storing your table code. This will append your rows
  3. Use build string if you have to build something else in for loop for list A 
  4. Send email notification (based on your requirement it can be inside 1st for loop or outside 1st for loop) 

View solution in original post

0 Kudos
Reply
klmerrills
Nintex Newbie

Re: Workflow to pull items from two lists with looping and email notification

Jump to solution
Thank you for responding so quickly. I was able to take you suggestions and get the workflow to pull items from both lists. Much appreciated.
0 Kudos
Reply