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 Apps / Export excel with maxi...
Power Apps
Answered

Export excel with maximum number of records

(0) ShareShare
ReportReport
Posted on by 1,032

Hello everyone
I created a canvas application from a sql database which contains tables with more than 5000 records, I have to export an excel file from the galleries which contain filters. I managed to export it but the problem is that it only contains the first 2000 recordings. Is there a solution to have all the records on the excel file? (Note that there is no sign of delegation)

Categories:
I have the same question (0)
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @gikido,

    If you want to export records more than 2000 from SQL to Excel in Power Apps, you could create csv table based on the collection you generated from Power Apps, here I will show you how you generate collection to save more than 2000 records.

     

    Note that we will pass one collection to multiple collection (Each collection having 2000 records). Based on record count dynamically create collection and passed to Power Automate flow.

     

    Here is the detailed steps:

    1). Set a variable to count the RecordsCount/2000, you could set the OnStart property of the App as below:

    Set(_count,3)

    2). Generate multi collections as below:

    Switch(
     _count,
     1,
     ClearCollect(
     colUpto2000,
     ShowColumns(
     Filter(
     Stage,//This is my data source
     Count <= 2000//Here is the column to displat the record index
     ),
     "ID",
     "Title",//Here is the column you want to export to excel file
     "Item"
     )
     ),
     2,
     Concurrent(
     ClearCollect(
     colUpto2000,
     ShowColumns(
     Filter(
     Stage,
     Count <= 2000
     ),
     "ID",
     "Title",
     "Item"
     )
     ),
     ClearCollect(
     col2001To4000,
     ShowColumns(
     Filter(
     Stage,
     Count > 2000 And Count <= 4000
     ),
     "ID",
     "Title",
     "Item"
     )
     )
     ),
     3,
     Concurrent(
     ClearCollect(
     colUpto2000,
     ShowColumns(
     Filter(
     Stage,
     Count <= 2000
     ),
     "ID",
     "Title",
     "Item"
     )
     ),
     ClearCollect(
     col2001To4000,
     ShowColumns(
     Filter(
     Stage,
     Count > 2000 And Count <= 4000
     ),
     "ID",
     "Title",
     "Item"
     )
     ),
     ClearCollect(
     col4001To6000,
     ShowColumns(
     Filter(
     Stage,
     Count > 4000 And Count <= 6000
     ),
     "ID",
     "Title",
     "Item"
     )
     )
     )
    )

    3). Create a flow as below, note that you just need to select the Ask in Power App from the trigger within the Compose.

    vqiaqimsft_0-1669948916490.png

     

    4). Set the OnSelect property of the button that triggers the flow as below:

    ExportExcelFlow.Run( 
    JSON(
    Sort(
    col4001To6000,
    Count,
    Ascending
    ),
    JSONFormat.IncludeBinaryData
    ),
    JSON(
    Sort(
    col2001To4000,
    Count,
    Ascending
    ),
    JSONFormat.IncludeBinaryData
    ),
    JSON(
    Sort(
    colUpto2000,
    Count,
    Ascending
    ),
    JSONFormat.IncludeBinaryData
    )
    )

    Note that ExportExcelFlow is the flow name.

  • gikido Profile Picture
    1,032 on at

    Hi @v-qiaqi-msft 

    Thank you for your answer, it's really great.
    I will try this method and I will come back to tell you the result.
    thanks again

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard