Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / Export Gallery Data to...
Building Power Apps
Unanswered

Export Gallery Data to CSV (item limit issue)

Posted on by 102
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
);
  
  • Matt-991599 Profile Picture
    Matt-991599 102 on at
    Export Gallery Data to CSV (item limit issue)
    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? 
  • CA1105 Profile Picture
    CA1105 101 on at
    Export Gallery Data to CSV (item limit issue)
    I agree with WarrenBelz,. You can use filter function in your ForAll instead of gallery.Allitems to get more then 100 records.
  • WarrenBelz Profile Picture
    WarrenBelz 140,745 on at
    Export Gallery Data to CSV (item limit issue)
    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

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,745

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard