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

Collect two galleries and export to excel

Can someone guide me, 

I've two galleries one primary and one secondary nested gallery.

Gallery one pulls data from one sharepoint list1 and nested gallery brings in data from 2nd sharepoint list2 .

Looking at the screenshot, for this Gallery 1 we have set filter with date range dropdown controls and searchboxes to isolate the right records. sharepoint list 1 is related to via column name "master Id" in 2nd sharepoint. I need to export the data of gallery 1 and related gallery 2 items to excel. I was thinking of using collection but i'm not sure how to go about. Am i supposed to have two separate collection for each collection and then merge into one collection for the export. I was looking at reza dorrani video's on excel export but i got stuck with the collection part. Can someone help?

 subgallery select button.jpgsubgallery items..jpgMain gallery items.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @chand72 ,

 

Sorry to disturb you, the problem in this post seems to be the same as in another post.

So, If someone has a similar question, maybe you could find the answer here.

 

Best Regards,
Wearsky

 

View solution in original post

5 REPLIES 5
v-xiaochen-msft
Community Support
Community Support

Hi @chand72 ,

 

According to your description, I did a simple test for you.

 

1\ This is my ‘ParentList’. ‘Test’ is a Single line of text column.

v-xiaochen-msft_0-1616404228822.png

 

 

2\ This is my ‘ChildList’.

v-xiaochen-msft_1-1616404228823.png

 

 

3\ Add a gallery control and set its Items property to:

ParentList

 

4\ Insert a gallery control into first gallery control and set its Items property to:

Filter(ChildList,MasterID=ThisItem.ID)

 

5\

v-xiaochen-msft_2-1616404228827.png

 

 

6\ Add a button control and set its onselect property to:

ClearCollect(ColCollection_1,ShowColumns(Gallery1.AllItems,"Title","Test","ID"));
ClearCollect(ColCollection_2,ShowColumns(ChildList,"Title","MasterID"));
ClearCollect(ColCollection_3,AddColumns(ColCollection_1,"ChildTitle",Filter(ColCollection_2,MasterID=ID).Title))

 

7\ The result is as follows:

v-xiaochen-msft_3-1616404228828.png

 

v-xiaochen-msft_4-1616404228829.png

 

v-xiaochen-msft_5-1616404228829.png

 

 

If you want to expand the collection, please try to add another button control and set its onselect property to:

ClearCollect(ColCollection_4,Ungroup(RenameColumns(ColCollection_3,"Title","ParentTitle"),"ChildTitle"))

 

v-xiaochen-msft_6-1616404228831.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

I was not able to create the third collection, pasted error here. Invalid argument. MasterID column my 2nd sharepoint list is a ordinary number column but used as lookup for the 1st sharepoint list.

chand72_1-1616433704424.png

 

 

Ok i managed to fix this by adding ID Into the collection 1 like this so error gone but looking at the collection data data is missing from the first collection , and third collection. I dont see the complete list. Collection 3 is totally wrong data displayed.

chand72_2-1616434890015.png

chand72_4-1616435146693.pngchand72_5-1616435182431.pngchand72_6-1616435266049.png

 

 

 

Managed to figure out by comparing my two sharepoint lists, collection 1 first 5 records didn't have data in balance column which is correct and collection 2 didn't have data for the first five records under those highlighted columns from the screenshot. However I can't figure out why collection 3 is not showing the right data for the 5 records, it keeps repeating the collection 2 header names. Can someone help me?

chand72_0-1616499257156.png

 

v-xiaochen-msft
Community Support
Community Support

Hi @chand72 ,

 

Sorry to disturb you, the problem in this post seems to be the same as in another post.

So, If someone has a similar question, maybe you could find the answer here.

 

Best Regards,
Wearsky

 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,329)