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 / How Do I Clear My Coll...
Power Apps
Answered

How Do I Clear My Collection?

(0) ShareShare
ReportReport
Posted on by

Hi, I believe I need to clear my collection, but I'm not entirely sure how. 

The problem is whenever I try to export to .csv from Power Apps using the download icon, it only appends whatever new data was produced in my most recent filter and search of the gallery. When it appends, the prior information is not deleted. We need a way to completely remove whatever was in that collection (I'm assuming), for this to work. What do I do?

As you can see, there should be 3 sets of duplicates here. There should be NO duplicates or appended data. All new reports should have fresh data from the search and filter. 

levoncosta_0-1675126132104.png


Here is the code:

 

Set
(ExportFinanceCSVVar,"");

ForAll(FinanceBrowseGallery.AllItems,Collect(ExportCSVCol,

{
Name: FinanceEntryOwnerTitle.Text,
Project: FinanceProjectTitle.Text,
TaskCategory: FinanceTaskCategoryTitle.Text,
Department: FinanceDepartmentTitle.Text,
Region: FinanceRegionTitle.Text,
HoursWorked: FinanceEntryHoursWorked.Text,
DateWorked: FinanceEntryDateWorked.Text,
CapEx: FinanceCapExTitle.Text
}));
Set(ExportFinanceCSVVar,Concat

(
ExportCSVCol,
Name & "," & Project & "," & TaskCategory & "," & Department & "," & Region & "," & HoursWorked & "," & DateWorked & "," & CapEx & Char(10)
));
Set(
CSVExportSuccessVar,
ExportFinanceCSVEmail.Run
(
"Finance ERP Report",
ExportFinanceCSVVar
).completed

);

 

Thanks, all! 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @levoncosta ,

     

    Please try:

    Set
    (ExportFinanceCSVVar,"");

    Clear(ExportCSVCol);

    ForAll(FinanceBrowseGallery.AllItems,Collect(ExportCSVCol,

    {
    Name: FinanceEntryOwnerTitle.Text,
    Project: FinanceProjectTitle.Text,
    TaskCategory: FinanceTaskCategoryTitle.Text,
    Department: FinanceDepartmentTitle.Text,
    Region: FinanceRegionTitle.Text,
    HoursWorked: FinanceEntryHoursWorked.Text,
    DateWorked: FinanceEntryDateWorked.Text,
    CapEx: FinanceCapExTitle.Text
    }));
    Set(ExportFinanceCSVVar,Concat

    (
    ExportCSVCol,
    Name & "," & Project & "," & TaskCategory & "," & Department & "," & Region & "," & HoursWorked & "," & DateWorked & "," & CapEx & Char(10)
    ));
    Set(
    CSVExportSuccessVar,
    ExportFinanceCSVEmail.Run
    (
    "Finance ERP Report",
    ExportFinanceCSVVar
    ).completed

    );

     

     

    Best Regards,
    Bof

  • levoncosta Profile Picture
    on at

    I feel like such a fool, but this worked. Thank you. 

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 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard