AnsweredAssumed Answered

Comparing SQL results to list contents

Question asked by troyhamiltonkmw on Nov 10, 2015
Latest reply on Nov 25, 2015 by stbrowne

I am trying to build a site workflow that would run nightly that would pull a SQL table,  compare the results to a SharePoint table and add any new items to the list.  The basic SQL pull and item creation are not issues - we do this type of thing regularly.  The thing I'm struggling with is how to make sure I don't create items that already exist in SharePoint. 


Does anyone have any suggestions on the best way to approach this? 


One thing I tried was pulling a column of the SQL table into a collection and the corresponding column of the SharePoint list into a collection. I then used a For Each to go through the SQL collection and a Run If to attempt to only do the create if the column value was not contained in the SharePoint list collection.  That didn't seem to work - the items were all created every time workflow ran. 


I appreciate any assistance you can offer.  Thanks!