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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Export Gallery Data to...
Power Apps
Unanswered

Export Gallery Data to CSV (item limit issue)

(1) ShareShare
ReportReport
Posted on by 149
Hi all,

I'm a bit of newbie to Power Apps, so am hoping someone can help me resolve an issue I'm having.
 
I have an app that includes a gallery linked to a SharePoint list data source. The SP list currently contains around 400 items, but will eventually contain approximately 5000 items. 

I have an 'Export to CSV' button on my gallery page to allow users to export either the full data set, or a filtered view of the data (by utilising search and filter controls on the gallery). The export is working fine, but I can't get it to export more than 100 items. I understand the gallery only displays the first 100 items from the list, until you scroll to show more items. I can't expect users to understand that they need to do that before exporting though, so need to find a way of making the export include more than 100 items.

I've attached the code from the OnSelect property of my 'Export to CSV' button. If anyone can help me tweak it to allow exports of more than 100 items, that would be great.
 
// Create a collection of the required columns
Clear(col_galleryData);
ForAll(
    'Name of Gallery'.AllItems As galData,
    Collect(
        col_galleryData,
        {
            Name: galData.activityName,
            Organiser: galData.activityOrganiser,
            Description: galData.briefDescription,
            Frequency: galData.dataSubmissionFrequency.Value,
            Attendee: galData.colleagueName.DisplayName,
            Email: galData.colleagueEmail,
            Division: galData.colleagueDivision.Value,
            BusinessUnit: galData.colleagueBusinessUnit,
            OtherColleaguesInvolved: Concat(galData.otherColleaguesInvolved,DisplayName, ", "), 
            CompetitionTeamApproval: galData.competitionTeamApproval.Value,
            StartDate: galData.firstSubmissionDate,
            EndDate: galData.benchmarkingEndDate,
            ActivityInactive: galData.benchmarkingInactive.Value,
            GuidelinesReviewed: galData.guidelinesAwareness
        }
    )
);

//Set JSON file
Set(
    _JSONFile,
    JSON(col_galleryData,JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes)
);

//Show notification
Notify("Export process started.",NotificationType.Success);

//Launch Power Automate flow
Launch(
'BenchmarkingActivityRegister-Flow4'.Run(
    _JSONFile,
    $"{User().FullName}{Now()}.csv").sharepointfilelink
);
  
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at
    Instead of 'Name of Gallery'.AllItems, you need to use the actual Items of the gallery (example)
    ForAll(
       Filter(
          ListName,
          YourFiltersHere
       ) As galData,
       Collect(
          col_galleryData,
          {
             . . . . . 
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • CA1105 Profile Picture
    545 Super User 2025 Season 2 on at
    I agree with WarrenBelz,. You can use filter function in your ForAll instead of gallery.Allitems to get more then 100 records.
  • Matt-991599 Profile Picture
    149 on at
    Hi @WarrenBelz,
     
    Thanks so much for the guidance. Your suggestion definitely seems to have solved the problem.

    I am now getting a 'Bad Gateway' ('The server did not receive a response from an upstream server') error intermittently though when trying to export the data. Is this something that I can do anything to resolve? 
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at
    Does your collection contain the records you expect ? This seems to be an issue unrelated to the data itself.
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at
    Is the CSV output influenced in any way by the user interacting with the app?  If not then you could simply include a link to the CSV file on the sharepoint.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard