web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow to import parsed ...
Power Automate
Answered

Flow to import parsed lines to SharePoint list errors with 5000 limit

(0) ShareShare
ReportReport
Posted on by 12

Hello, first, want to say I'm new to the community and this topic has been discussed but don't see anything that resolves my issue.  So please bear with me.  I have a log that is generated (pipe delimited) every hour and only has three columns. A notification email with the log attached is sent every hour.  I set up a SharePoint list with proper column names and generated a flow to import to the list when a new email arrives.  Standard stuff.  The attachment is base64 decoded, parsed by line, parsed by pipe, and converted to JSON.  A connection to the SharePoint list is made and an Apply to each operation is triggered to import the values.  However, the reports average about 10K lines every hour and I'm getting the "The number of foreach items limit exceeded for action 'Apply_to_each_2': maximum '5000' and actual '31075'" error (this is a bigger number because I need to import a backfill).  Questions:

 

1.  Is this a SharePoint configuration issue?  I know the default is 50000.

2.  If so, can this be changed in the Admin portal?  I am admin and owner of the site.

3.  Or is this Power Automate issue?  If so, can this be configured to a larger number?  I have a premium subscription.

4.  Or do I just need to import the max and change my flow?  If this is the case, can someone give an example or point me in the right direction?

 

Really appreciate any help. Thank you, DB7176

Categories:
I have the same question (0)
  • SamLed Profile Picture
    2,338 Moderator on at

    Hi,

     

    That's a Power Automate limit (not issue): Limits of automated, scheduled, and instant flows - Power Automate | Microsoft Learn

     

    I would suggest to process your data by batches:

    • Compute batch count: items count / Batch size
    • use Do until loop
    • Use take() function to get n first items
    • On next loops, use take() from skip() function output to get next batch. skip count is: (Batch size x (current loop index +1))

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

  • DB7176 Profile Picture
    12 on at

    Hello, thank you for responding.  That makes sense and understand it's a feature not an issue.  Great suggestion.  Going to give it a try this weekend and see how it goes.  New to Power Automate processes so will have to do some research and dig in.  Will update the post with results.  Thanks!

  • Verified answer
    SamLed Profile Picture
    2,338 Moderator on at

    Hi,

     

    Here's a flow to illustrate what I meant:

     

    I've created an array containing 20 items in a Compose action as source:

    SamLed_0-1693610528314.png

     

    I initialize 4 variables:

    SamLed_1-1693610725969.png

    And

    SamLed_1-1693652973590.png

     

    Expressions:

    • length(outputs('Compose'))
    • add(div(variables('ItemCount'), variables('BatchSize')), if(equals(mod(variables('ItemCount'), variables('BatchSize')), 0), 0, 1))

    NB: Last expression compute required batch count, we need to increment by 1 when the rest of the division "ItemCount / BatchSize" is not zero .

     

    Now let's make batches:

    SamLed_3-1693610940157.png

    Expression: take(skip(outputs('Compose'), mul(variables('BatchSize'), iterationIndexes('Do_until'))), variables('BatchSize'))

     

    NB: I use IterationIndexes('Do_until') rather than variables('BatchNum'), because the index must be base 0 so that skip() does not exclude an element during the first loop. It turns out that here "BatchNum" is base 0, but it should be able to change base as needed.

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

  • DB7176 Profile Picture
    12 on at

    Thank you SamLed for your detailed instruction.  Really appreciate it!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 60 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 54

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard