cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mahalakshmij_03
Frequent Visitor

Export to excel with the User selected SharePoint column on the UI Screen( Canvas app)

Hi All,

I have a requirement on the user basis SharePoint column selection on the UI screen (Canvas App) and export to excel for the chosen columns.

Currently I am using the below code on the button to execute the Power automate flow( Here I just randomly added some columns for testing)
 
But I need the columns as user's selected and that may vary each and every time..(User DONT WANT TO SEE ALL THE COLUMNS IN THE EXCEL OUTPUT)
 
CODE:
Concurrent(Notify("Downloading the Excel file......",NotificationType.Information),
ForAll(colPreview,Collect(Colnew,{ID:ThisRecord.ID,Function:ThisRecord.Function.Value,Status:ThisRecord.'Status',Log Note:ThisRecord.Log})); Set(varFileLocation,ExportExcel.Run(JSON(Colnew,JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes)).filelocation)); Launch(varFileLocation); Clear(colPreview);
 
 
 Can you help on this
Thanks in Advance,
Maha
1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @mahalakshmij_03 ,

 

Do you want to create a excel file that contains the multiple selected columns?

 

Based on your description, I have made a simple test for your reference.

 

Test SharePoint list:

vjefferni_0-1669713745562.png

 

It is needed to get values of all columns and then drop the unselected columns:

vjefferni_1-1669713745569.png

 

Result:

vjefferni_2-1669713745570.png

vjefferni_3-1669713745571.png

vjefferni_4-1669713745571.png

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-jefferni
Community Support
Community Support

Hi @mahalakshmij_03 ,

 

Do you want to create a excel file that contains the multiple selected columns?

 

Based on your description, I have made a simple test for your reference.

 

Test SharePoint list:

vjefferni_0-1669713745562.png

 

It is needed to get values of all columns and then drop the unselected columns:

vjefferni_1-1669713745569.png

 

Result:

vjefferni_2-1669713745570.png

vjefferni_3-1669713745571.png

vjefferni_4-1669713745571.png

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

mahalakshmij_03
Frequent Visitor

Thanks a lot @v-jefferni  This is what I need. - Dynamic Column selection. I will try it out. 

mahalakshmij_03
Frequent Visitor

@v-jefferni  And could you please suggest the solution for the Auto width for the column generated in this excel.

 

User also wants in the order as they provided. For eg: Log Note, Function, ID,.. 

Basically Collection parameter results only in the Alphabetical order. We have option in the Power Automate as " Custom column" in the Create CSV action but don't know how its works for our method of passing collection.

 

Thanks for your support.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,612)