Workflow Soluiton

 View Only
  • 1.  Multiple entries in collection

    Posted Apr 26, 2011 10:18 AM

    I have a number of workflows that get data from a SQL table and populate a collection based on whether a field has been set to true.  The collection is then used to populate a Grid Component on a form for selection.  Once the item from the collection is processed I set the feild in the collection and I have it go thru a "Remove items from collection" component to remove it from the collection.  The issue I'm having is that the first time I open the form I have multiple entries for each item. Once I process the item all entries for that item are removed.



  • 2.  RE: Multiple entries in collection
    Best Answer

    Posted Apr 26, 2011 11:47 AM

    You can run your collection through a Test Collection for Duplicates component to remove the duplicates if you have any.



  • 3.  RE: Multiple entries in collection

    Posted Apr 26, 2011 08:22 PM

    If you are getting multiple rows back from the SQL server you should modify the SQL query to filter out the dupes. It's much faster to have the SQL server do this work as that is what it is designed to do.

     

    rob



  • 4.  RE: Multiple entries in collection

    Posted Apr 28, 2011 02:25 PM

    No.. it's not the SQL query.. I believe its in the collection loop.    So real basic.. I have a SQL component bringing in the contents of a SQL query.. The next component is a For Each Element in collection.  Then a equals rule that checks for a bit,  The equals outputs to a Add Item to collection component.  The no equals loops back to the add item to collection rule.  Out of the Add Item to Collection I loop back to the "For each Element in Collection" until Finished which drops out to my form where I select an item.  The item is then processed and loops back to a Remove items From Collection which then feeds into SQL component. 



  • 5.  RE: Multiple entries in collection

    Posted Apr 28, 2011 03:05 PM

    Hey reccardo.. got an example somewhere on how to use this check collection for duplicates



  • 6.  RE: Multiple entries in collection

    Posted Apr 28, 2011 03:29 PM

    The Test Collection for Duplicates component is fairly easy to use. You populate the Data Type and Array Variable Name to get the array we're checking for, then you have the option of outputting a distinct value list. If you use this option, you can overwrite the exact same array you specified in Array Variable Name to make that list distinct.



  • 7.  RE: Multiple entries in collection

    Posted Apr 28, 2011 03:42 PM

    Yeah.. DUH.. it was simple.. I just wasn't sure what to do with one of the outputs.  In my case I was able to just connect both outputs to the same input of the next component.   Thanks