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

Select records from a gallery / Import data to Excel

Hello everyone,

 

I was wondering how I can select records from a gallery and then import those records to an excel file? I want something similar to the functionality import to excel that already exists in dynamics CRM!! 

 

Thank you !!! 

4 REPLIES 4
Dual Super User II
Dual Super User II

Hi @Warda 

 

Direct export to excel is not supported. As a solution to this limitation, I developed a PCF control and when you pass a JSON formatted string as the value, it save the content as an Excel file.

You can refer to my blog on: https://www.bythedevs.com/post/export-to-excel-from-canvas-apps-in-power-apps-using-pcf 

Note: If you want to pass only selected items, you can make such a configuration where gallery selected records store in the collection and you can pass the collection in the input argument for the PCF control.

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hello @yashag2255 ,

 

Thanks for your answer !! I have the same issue and i'm still a beginner ! I tried to follow the steps in your blog but it's a little bit hard for me ! Is there any other easy solution to do that ?

 

Thank you ! 

Hey @FadwaSa 

 

Can you share where are facing issues while using this component? I will help you to use it properly.

Currently, there is no direct way to do this. Another workaround would be to use Microsoft Power Automate but that is again a tedious process. That is why I came up with this PCF control to ease up the process and increase the speed.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support
Community Support

Hi @Warda ,

Could you please share a bit more about your scenario?

Do you want to select records within the Gallery, then import these selected records into your Excel table?

 

Based on the needs that you mentioned, I think the Checkbox control, Patch function and ForAll function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

1. Add a Checkbox control within your Gallery (which connects to your D365 CRM Entity). If you want to import the record from the Gallery into your Excel, please check the corresponding Checkbox within the Gallery Item.

2. Add a "Submit" button outside the Gallery, set the OnSelect property of the "Submit" button to following:

ForAll(
        Filter(Gallery1.AllItems, Checkbox1.Value = true),  // filter Gallery Items with the Checkbox checked
        Patch(
              'YourExcelTable',
               Defaults('YourExcelTable'),
               {
                 ExcelTableColumn1: CRMEntityColumn1,
                 ExcelTableColumn2: CRMEntityColumn2,
                 ExcelTableColumn3: CRMEntityColumn3,
                 ...
               }
        )
)

 

Please check and see if my solution within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/How-to-patch-a-checkbox-from-a-gall...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Within-a-Gallery-Set-the-value-of-a...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,361)