AnsweredAssumed Answered

Query of Second Occurrence of 'For Each Loop' does not work

Question asked by sshaffer on Nov 15, 2018
Latest reply on Nov 15, 2018 by sshaffer


I have been trying to get this to work for weeks.  I have read numerous posts on the subject, but cannot get this to work.


I have created a collection of collateral types called vCollCollateralList based on a multi value column.  Then, I want to use each collateral type and query another list (Checklist Template) to create a checklist.  The second collection is called vCollStepName.


I do this with a For Each loop on vCollCollateralList and I store result in itemCollateralType.  Then I query a list called 'Checklist Template' with filter set to Collateral Type is equal to itemCollateralType (from the For Each Loop) and save in a collection called vCollStepName.  Then I do a count of vCollStepName to make sure I picked up steps.


The first occurrence (first collateral type) of this works fine, but when it loops around the second time, I know the 'For Loops' picks up the value of the 2nd collateral type correctly (as shown in History Log), but when I use the second collateral type to query Checklist Template, it does not find anything. 


Example: I have 3 Collateral types - CHT, EMV, ENL.  Each of these has 3 steps in 'Checklist Template'.

First loop - retrieves 3 steps for CHT

Second Loop - retrieves 0 steps for EMV

Third Loop - retrieves 0 steps for ENL


If I remove CHT, and run the same thing for EMV, ENL

First loop - retrieves 3 steps for EMV

Second Loop - retrieves 0 steps for ENL.


Does this make sense?  Any ideas?  Thanks in advance for your help!