Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Suggested answer

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

Like (1) ShareShare
ReportReport
Posted on 11 Sep 2024 23:19:49 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
    FLMike Profile Picture
    FLMike 27,286 on 12 Sep 2024 at 04:25:37
    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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,696

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,456

Leaderboard