0
votes

I have a workflow from a Document Library that copy the file to another Document Library and then "Update Item in" on this other Document Library through lookup. However the workflow won't work because where the file is copied the Document Library has more than 5k files and the List View Threshold is setup for only 5k.

I tried to create a specific field on both Document Library that the workflow could do the lookup, but I still get the same error. I was wondering how to make the workflow lookup on a different Document Library with exceeded list view threshold without changing the list view threshold limit.

This is the erro that I get from the workflow status:

"The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator."

1

1 Answers

0
votes

A better solution would be to parse out your document libraries so they aren't exceeding the list view threshold. Assuming you're running 2013 since you tagged it in your post, you could have the workflow do a REST API call to the destination library and check the item count. If it returns >5000, alert the document library manager to archive some old files - or save the file to an alternate library using an If/Then block.

The SPD Workflow to do this:

Build {...} Dictionary (Output to Variable: requestHeaders)
then Call [site url]/_api/web/Lists/GetByTitle('[Library Name to Query]') HTTP web service with request (ResponseContent to Variable: responseContent|ResponseHeaders to Variable: responseHeaders|ResponseStatusCode to Variable: responseCode)
then Get d/ItemCount from Variable: responseContent (Output to Variable: count)

If Variable: count is less than 5000
  [Proceed as normal]
If Variable: count is greater than or equal to 5000
  [Save to secondary library and notify admin to do some cleanup]

(Here's some background on REST API if you haven't used it before)