cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Warda
Level: Powered On

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
Dual Super User

Re: Select records from a gallery / Import data to Excel

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!

FadwaSa
Level: Powered On

Re: Select records from a gallery / Import data to Excel

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 ! 

Dual Super User
Dual Super User

Re: Select records from a gallery / Import data to Excel

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 Team
Community Support Team

Re: Select records from a gallery / Import data to Excel

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,466)