cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thondal
Frequent Visitor

Error during flow - Number of foreach items limit exceeded for action 'Apply_to_each': maximum '5000'

Hi, I have a flow that gets a array of items from an external API. 

I then try to create 1 item in a sharepoint list per returned array object/array item. But the api returns more than 8k results, and the limit for the apply each is 5000. 

 

The exact error message:
Unable to process template language expressions for action 'Apply_to_each' at line '1' and column '5354': 'The number of foreach items limit exceeded for action 'Apply_to_each': maximum '5000' and actual '8437'.'.

 

(I have searched and searched to see if this issue has been resolved in some way, but I was unable to find a suitable solution)

The flow looks like this

flow.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
edgonzales
Super User
Super User

@Thondal 

Hi there.  I think that limitation is dependent on your licensing plan.  Is your intent to have this flow run regularly and automatically?  Or is this just a one-time import kind of thing?

 

You could filter the results to break the data up a bit.  Depends on the rest of your flow, I guess.

 

Keep us posted.

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

2 REPLIES 2
edgonzales
Super User
Super User

@Thondal 

Hi there.  I think that limitation is dependent on your licensing plan.  Is your intent to have this flow run regularly and automatically?  Or is this just a one-time import kind of thing?

 

You could filter the results to break the data up a bit.  Depends on the rest of your flow, I guess.

 

Keep us posted.

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Thank you. It seems this is the solution.

Yes this is a recurring task. I will most likely be using the following example to handle the "check for existing item" before updating or creating the items in list. 

Thank you for the quick reply 🙂 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,102)