Skip to main content

I have a document library with about 30K files. I also have a list with about 5K rows. Both the list and the library have a DocNo column. I need to create a (site?) workflow where all documents in the library that have a corresponding record in the list (based on DocNo) will have a column X updated. So this is how far I got:

2016-04-05_15-34-28.png

  • I query my list and save all DocNo in a Collection variable
  • For each DocNo in the collection I look for a document in a library with the same DocNo and then I update it

Unfortunately after updating 3 items it gives me an error. I believe this is because it is not finding a document with the specific DocNo in the library. I will try to comb the logs and confirm that. If this is the case how can I skip such items instead of crashing the workflow? Any chance I can test before if the item in the library has a matching item in the list? Thanks!

Hi Igor.

Definitely use "Log in History" to track the results of your "Query List" as well as each item that is being looped.Print out that "DocNo" value in your loop since it is the key of your "Update Item" action.

I am not sure what is the condition you have set in your Query List action. But you can use another Query List action in your For loop to check if the item exists before updating. But it will also slow down your for loop performance considering there are 30k files !

I would suggest you limit the number of results returned by Query List so you can debug what the issue is. This would reduce your dev time too happy.png

Hope this helps


Hi Igor Karon​,

You could look at doing a Query list action on your document library and storing the DocNo in a separate collection variable. Then you could use a Collection operation to check the value exists before continuing:

182297_pastedImage_0.png

You'd need to look at any performance implications though, Collection variable performance considerations

Jan


It was too complicated to make it work. I was also getting timeouts and other errors. I ended up using ShareGate Migration to do this.


Reply