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

Power Apps Export Excel Design (Need some ideas)

Hello dude,

 

My boss want to have export collection to Excel within app, I know it is not easy to achieve, I came up with following procedures:

1. Write a Gallery for the Collection,

2. Write `Label.Text` for `Gallery.AllItems` in the form of CSV with a CSV ID,

3. Use Power Automate to generate a CSV file with ID and start timing with a hidden timer, binding the Power Automate to Apps,

4. Write a web mail service to catch the email attachment coming from Power Automate and generate a HTTP Post request,

5. Write an API service to catch the HTTP Post request, generate an Excel download page, url set as ID

6. Wait for certain seconds (to make sure server finished processed) on the hidden timer to trigger `Launch(URL)`

 

---

Ps.

1. My company has certain limits, so it must to be done in Power Apps.

2. The reason that I don't just pass the CSV in `Launch(URL&CSV)` for easier HTTP Get request is because of URL length issue.

3. Not sure how in this case can I return the URL back to Apps, so I have to use the wait seconds strategy.

 

Sorry if the content is too complicate, potentially a really big project ahead of me, want to ask suggestions before start doing.

 

Thanks in advance!

2 REPLIES 2
Super User
Super User

You can use the JSON() function in Power Apps to convert your collection to JSON

Set(JsonCollectionTest, JSON(CustomGallerySample, JSONFormat.IncludeBinaryData))

Then pass the JSON to Power Automate and create your CSV from there with this example:

https://powerusers.microsoft.com/t5/Building-Flows/JSON-to-Excel-or-CSV-to-Excel/td-p/443890

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

See attached for a simple option within PowerAutomate. You may want to just have the Flow email the CSV to the user for simplicity sake, I could not find a good way to save the CSV from PowerApps. If you are on mobile exclusively, you can use the SaveData() function.

In Power Apps, your formula would look like this:

Set(JsonTest, JSON(CustomGallerySample, JSONFormat.IncludeBinaryData));
ClearCollect(csvExportFile,JsonCSV.Run(JsonTest));

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (13,110)