web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Export PowerApps Colle...
Power Automate
Unanswered

Export PowerApps Collection to Excel Sheet

(0) ShareShare
ReportReport
Posted on by 96

Hello All,

 

Thank you for reading today and thank you in advance for your help/insights - it is much appreciated! I have done a lot of research on this topic, but every solution I seem to try is outdated and doesn't work the same way anymore. In particular, I am struggling with the JSON formulas.

 

What I need to do is take two collections and export them into an Excel file.

My scenario is that I am building a timesheet application as seen here:Example.PNG

The user inputs information into the gallery and I am using a "ForAll( Collect " on those selections/inputs to store them into a collection. I then want to take those collections and have power automate transform them into Excel files, but that is where I am stuck and am struggling to move forward.

 

Any help would be greatly appreciated!! 

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,351 Super User 2025 Season 2 on at

    Hi @Keegancurrie 

     

    Truly not necessary hehe to explain what you think doesn't work, most of the time, it just clouds the issue and we aren't judging, so it just adds extra time to us to find out what you need.

     

    Looks great though nice work on the UI!

     

    As for what you want

     

    1. You don't need to store that in a collection (and just adds a lot of overhead and memory footprint to your app), unless you use it for anything else.

     

    2. I can only give you a super high level base idea of what to do, because I cannot see your collections etc.

     

    3. I do not know if you need data from both collections in a single row and you didn't explain how they relate to each other etc.

     

    4.  depending on what you are doing you do not need a flow, you can do all the actions in your Canvas App

     

    5. You maybe able to join the collections instead of making it 2 , not sure though yet.

     

    Steps

    1. Create an Excel File that already has all the columns and Headers etc in it.

    2. Make sure the Excel file has a Table created around the headers and

    3. Create a flow that uses the Power Automate V2 trigger

    --define parameters for the incoming 2 collections (as text)

    4. Create a Parse JSON action for EACH collection to turn it into something that flow can use

    OR

    if the stuff is an Array then use 2 Initialize Variables, make them Array types, and set the Value equal to the Incoming Collection. 

    5. Create an Apply to each loop around (one of the collections Parse JSON) data

    --Inside use the Add a row to a Table (Excel Action)

    --Populate the columns with the data

     

    And done

     

    Unfortunately without more specific details thats as close as I can get you.


    If you like my answer, I would really appreciate if you please Mark it as Resolved, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • Keegancurrie Profile Picture
    96 on at

    Hi @FLMike!

     

    Thank you for replying I really appreciate it! And thank you this is one of the first apps I've made so I'm proud of it hahah - So I appreciate the compliment!

     

    I will provide a more detailed rundown of what is happening:

     

    So the reason I have two collections is because there are two aspects to this timesheet app. It functions as a timesheet for both employeesExample2.PNG and equipment Example3.PNG - the stacked rows will be invisible to the end user as they are automatically filled with info that relates to the first combo box - I just have those there while developing. The two galleries, one for equipment and one for employees populate two different collections with this: Example4.PNG and the corresponding collections look like this:   Example5.PNG and this Example6.PNG The app's data source is Dataverse and I also have  a page that allows management of those data tables that look like this: Example7.PNG. Ideally, the two collections are then compiled through a button push into two separate Excel files that an administrator would then email directly to payroll.

     

    I had them collected into collections purely because I thought that was what I had to do to deliver them to Power Automate. If I can accomplish this in a more simple way that would be awesome!

     

    Thank you again!!

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,351 Super User 2025 Season 2 on at

    @Keegancurrie 

     

    Hello and thank you kindly for the great explanation.

     

    Is your struggle with sending them to Power Automate, or from Processing them once you get them there?

     

    To just send,

    1. Use the Power Automate (V2) 

    -Create 2 input parameters (both strings) -- please note, feel free to add whatever else you want also as extra inputs

    --let's call the first one EquipmentJSON

    --let's call the second one EmployeeJSON

     

    NOTE: If you used a different trigger such as the V1 trigger, please delete that trigger, and re-add the V2 trigger. 

     

    2. Add your Flow to the Application.

    If you have already, and you will need to go to the Flow Tab (clicking the Flow Icon on the left side) and click the ... and choose refresh from the popup. This will make it understand that you changed the flow.

     

    If you have not, just add it here by clicking Add Flow.

    NOTE: please make sure you created the Flow In your Solution or you wont see it.

     

    3. To pass it to the Flow, pass it like this

    MyFlow.Run(json(myequipmentcollection), json(myemployeecollection))

    using the json expression to convert the string to a JSON string

     

    4. We want to use Parse JSON to turn these into nice JSON objects, but right now they are just json Strings. To do this will take a couple of pre-steps.

    Step A) Create a Dummy Flow inside your Solution, (there are other ways, Im just showing you a trick you can use later on)

    Step B) set the Trigger to Power Automate (V2)

    Step C) Add your inputs EquipmentJSON and EmployeeJSON

    Step D) Add to Compose Actions

    In each one put one of the Inputs (doesnt matter the order)

    Step D) Add this to your Application

    Step E) Call this (instead of the real flow)

    Run the app one time.

    --We want this so that we can have an example of what the JSON will look like.

     

    Now that you have that, change your App to call your real flow and start back at step 5

    5. In your flow, you can add 2 Parse JSON actions.

    --In the first one you would have the input as your Trigger Input Equipment JSON

    --In the second one you would have the input as your Trigger Input Employee JSON

     

    Now, you will want to click the Create Schema from an Example button.

    We want to use the JSON string that you created in the Compose OUTPUTS, in your dummy flow, but we also want to validate the JSON.

    NOTE: a great way to validate the JSON 

    i) download and installed Notepad++

    ii) install the jsonviewer plugin (its free and safe)

    iii) once installed click File/New in Notepad++. On that tab paste in the one of the Compose outputs from the tab. Then click Plugins, select JSON Viewer, then select Format as JSON. You can also paste this into your 

    FLMike_0-1697465448774.png

    So once you have validated it, copy it and paste THIS into the Schema Example Button Popup for its respective Parse JSON

     

    6. Now you have both objects as nice Parse JSON objects and you can see its dynamic properties etc.

     

    What I do not know is how you want to loop through etc. So please do the above steps and then explain how you need to loop through and join the data together? so that it can then be output into excel

     

    Steps for Excel

    A) you need to have an excel file already existing, with a Sheet and a Table in the sheet for you to add data too. You could create a file (that is sort of used as a templet). When this flow runs, it would make a copy of that file, and then modify/add/delete rows in THAT copy/table instead of your "template".

    NOTE: its not really a template in the true sense, its just a file you dont change.

     

    B) loop through your collections, which are easy now thats in a Parse JSON format

    C) use the Add a row to a Table (Excel) action to write the data


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • Keegancurrie Profile Picture
    96 on at

    Thanks Mike I got it now much appreciated 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard