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 to export collecti...
Power Apps
Unanswered

How to export collection in to excel file (Only selected columns by the user should be exported)

(0) ShareShare
ReportReport
Posted on by

Hi Folks,

 

I'm trying to build an export to excel functionality in a canvas app where user can select specific columns which should be exported from the gallery. The collection in the gallery has around 21 columns from which user can choose whichever columns to be removed from the excel file. 

 

I'm trying to achieve this in canvas app but so far no luck. Even if I hard code column name and use drop columns, the final collection will still have those columns which user removed. It's just that it will have blank values. I'm using different collection other than gallery collection for handling export. But the schema is not changing.

 

The underlying data source is SharePoint. I'm having multiple filters in the app on the collection which should be reflected in excel (Filters with multiple target values for same column are allowed). 

 

Could anyone please suggest a work around?

 

Thanks

Categories:
  • MissingLink Profile Picture
    236 on at

    I would have tried the following, but an 'If' statement is not admissible inside a collect statement.

    UpdateContext({val1:true});
    UpdateContext({val2:false});
    UpdateContext({val3:false});
    UpdateContext({val4:true});
    
    ForAll(MySourceTable,
     Collect(
     colTest,
     {
     If(val1, Field1 : ThisRecord.fieldname1),
     If(val2, Field2 : ThisRecord.fieldname2),
     If(val3, Field3 : ThisRecord.fieldname3),
     If(val4, Field4 : ThisRecord.fieldname4),
     }
     )
     )

     

    That way I see it,

    Export all the data to Excel then run a powerAutomate over the resultant spreadsheet to remove the unwanted columns?  (Not that I know how to create the P/Automate.)

  • rbn_nue Profile Picture
    on at

    Hi @MissingLink 

     

    Thanks for your response. 

     

    Drop columns was actually functioning as expected. Even though it showed dropped columns in UI (which is misleading) it was not sending it power automate. For now I'm checking each columns with separate if statements and dropping them if user has unchecked. Not the best approach, but functioning for now.

     

    Thanks

  • Huahua1217 Profile Picture
    5 on at
    Hello @rbn_neu,
     
    I'm meeting the same problem with you.
    Have you already solved it? Could you show me how you fix it?
     
    Thank you very much!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard