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 / Export SharePoint Rela...
Power Apps
Answered

Export SharePoint Relationship data into Excel

(0) ShareShare
ReportReport
Posted on by 18

I have created relationship database in SharePoint. I want to export the both (Parent-List and Child-List) data in one click. 

But, here scenario is - In parent list have two records.

1) Record1

2) Record2

 

In child list have four records. First two records are corresponding to Record1 in Parent-List and last 2 records are corresponding to Record2.

Like below.

1) ChildRecord1 --> Record 1

2) ChildRecord2 --> Record 1

3) ChildRecord3 --> Record 2

4) ChildRecord4 --> Record 2

 

While exporting these data into excel. As of now I'm facing issue. Like It export Parent List data and In parent list have only two records. So, Its created two rows in excel file.

 

But, I want these data in four different rows. Like below.

 

 

1) Record1 --> ChildRecord1

2) Record1 --> ChildRecord2

3) Record2 --> ChildRecord3

4) Record2 --> ChildRecord4

 

Is there any way to achieve this one.

 

Below are collections I have created on set it on On Select of Export button.

Note - I added white space in between PowerApps keywords. Because unable to post this message over group. So please Ignore this one. 

ClearCollect(ColCollection_1,ShowColumns(Gallery1.AllItems,"Title","Initiative_Type","Function","Owners","Target_Date","Completed_Date","Impact","Status","ID"));
ClearCollect(ColCollection_2,ShowColumns(Task,"Title","HowToMeasure","Dependency_Other_Stakeholders","Status","Target_Date","Actual_Completion_Date","Ref_ID"));
ClearCollect(ColCollection_3,AddColumns(ColCollection_1,"SubTaskTitle",Filter(ColCollection_2,Ref_ID=ID).Title));


ForAll(ColCollection_3,
Collect(
colDataExported1,
{
A_Title_Initiative : ThisRecord .Title,
B_Initiative_Type : ThisRecord .Initiative_Type.Value,
C_Function : ThisRecord .Function,
D_Owner : ThisRecord .Owners,
E_Impact : ThisRecord. Impact. Value,
F_Target Date : ThisRecord. Target Date,
G_Expected_Completion_Date : ThisRecord . CompletedDate,
H_Status : This Record.Status.Value,
I_ID : ThisRecord.ID,

J_SubTaskTitle: ThisRecord.SubTaskTitle
}


)
);

 

Categories:
I have the same question (0)
  • VasileR Profile Picture
    298 Super User 2024 Season 1 on at

    Hi @deepPowerApp ,

     

    You can create a new collection that contains the data you want:

    ClearCollect(col_ExportData, 
     AddColumns(PARENT_LIST, 
     "Child_Record", LookUp(CHILD_LIST, RECORD_1_Column_FROM_CHILD = Record1_Column_from_Parent).CHILD_RECORD_1_Column_FROM_CHILD
     )
    )
  • deepPowerApp Profile Picture
    18 on at

    Hi @VasileR

     

    Already, I have created similar kind of collection (collection_3). It seems same code as you provided. Just changed filter condition.

     

    As you suggested - I added below code. But, still not working. It export only two rows from Parent list and added one title column from Child List. 

     

    deepPowerApp_0-1700726780170.png

     

    As each parent have two sub-tasks. So, It would create four different rows in export file. 

    We need to add some iteration in Child list. Not sure how we can add this.

  • VasileR Profile Picture
    298 Super User 2024 Season 1 on at

    You are right.

    Let's try:

     

    ClearCollect(col_ExportData,
     Ungroup(
     AddColumns(ColCollection_1,
     "Collection2Data", RenameColumns(Filter(ColCollection_2, Ref_ID = ID), "Title", "ChildTitle") ),
     "Collection2Data") )

    You might need to rename some other columns that have the same name, or just use ShowColumns.

     

  • Verified answer
    deepPowerApp Profile Picture
    18 on at

    Hi @VasileR,

     

    Thank you so much for responses.

     

    I found the workaround on it. I run the ForAll query on ChildList and added the ParentList columns in to ChildCollection.

    Below is the code -

     

    deepPowerApp_0-1700730236860.png

     

  • VasileR Profile Picture
    298 Super User 2024 Season 1 on at

    Glad you got it to work!

    Good luck with the low coding 🙂

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard