Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Suggested answer

How to export two sharepoint lists into one excel (csv) on powerapps

(1) ShareShare
ReportReport
Posted on by 6
Sharepoint lists:
DRS_main (contains SeqNum (as primary key), clientName, imexRefNum)
DRS_doctype (contains SeqNum (as reference key), sadBrokerDocDef, sadBrokerForReg)
 
I created a powerautomate on my powerapps to export sharepoint lists thru csv then will send to email the output but I cannot get the drs_doctype fields using this flow (see below) on my powerapps
  • Suggested answer
    Michael E. Gernaey Profile Picture
    44,154 Super User 2025 Season 1 on at
    How to export two sharepoint lists into one excel (csv) on powerapps
    Hi,
     
    There are a few ways, here is just one. 
     
    0. Create and Initialize an string. I suggest adding headers to it, so that it has the format you want AND has headers already (using commas separation) plus add a carriage return (using the encode
    here is agreat article, I know it talks about removing them using this, but it is also the way to add them.
    So the 0 line of code will be the headers + an expression adding the carriage return to the same string
     
    1. You are going to need to create an Apply to Each with the input being Doc Main
    Inside the Apply to each
    a. Do a Get items from the DRS docType using the Seq number you get from the current loop of step 2.
    b. add a Condition
    In the left side put the expression length('insert the body value from step a')
    middle make is equal too
    right 1
     
    This way you can check if you found the 1 record
    in the yes side
    c. use an Append to string, adding in all the fields from the Outer current Loop and the inner Current Loop together and also using the decode etc to add the carriage return
     
    When all of the looping is done, you will have a single string that has all the rows in it in a CSV format.
     
    Now you can use Create File using the String Variable 
     
    Done
     
    If this helps you please mark as the answer
     
     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1