Microsoft Flow - Apply To Each Limitation (5000 items)


What
Had a situation where I was pulling back 70,000 items in an array from a REST API call.  I wanted to create a SharePoint item for each of the items in an array, however the 'Apply To Each' action kept giving me the following error:

ActionFailed. An action failed. No dependent actions succeeded.

Why
This was due to a Microsoft Flow limitation. When you are using the Free Version of MS Flow you are limited to 5,000 items in a loop.  Explained here: https://docs.microsoft.com/en-us/flow/limits-and-config

Workaround
I tried my best to come up with a workaround, tried splitting up the array into batches of 5,000.  All to no avail.  in the end, gave up, and saved the array of items to a CSV and saved the CSV in a SharePoint Library instead.


body('Parse_JSON')?['applist']?['apps']


The only other alternative I could come up with is to grab the 'first 4999 items' from the array, which does work with an expression like this:  take(variable('array')?['applist']?['apps'],4999)

Comments

Popular posts from this blog

SharePoint - Field type [FieldName] is not installed properly. Go to the list settings page to delete this field.

Office 365 Groups - Quickly find the GUID of a O365 Group

Export Group Membership From Active Directory Using Power Query