Burgers & Bytes
September 12, 2025

Export Dataverse data to Excel triggered from Canvas app

Sep 12, 2025  •  2   • 330 
Table of contents

Introduction

Over a year ago I already wrote stated something we jokingly say: “What is the most frequently used functionality of an ERP system?”, with as the answer: “…the export to Excel”.

It is still an often request, which is there by default while creating a Model Driven app, while end-users often would like to export data in a Canvas app as well. This blog describes how to create a Power Automate flow which you can trigger via Canvas app to export the data from Dataverse into Excel.

Step by step

The steps which needs to be done:

  1. Set up the Fetch XML
  2. Setup the Layout XML
  3. Export the data
  4. Save the file

Setup the FetchXML

The easiest way is to do this via a Model Driven App and select to edit filters and downloading the FetchXML. Select the filters from the result you want to be able to download:

Edit filters

Download the FetchXML and paste the outcome into a compose action: FetchXML

Setup the LayoutXML

From the edit columns select which columns you would like to have and download the LayoutXML.

Edit columns

Download the LayoutXML and paste the outcome into another compose action: LayoutXML

Export the data

You can use the ‘HTTP with Microsoft Entra ID (preauthorized)’ action to setup the export. For the Base Resource URL and Microsoft Entra ID Resource URI you can enter the Dataverse URL of the environment the data belongs to. You can find that in the session details: Organisation url

The API request details:

FieldValue
MethodPOST
URL<orgurl>/api/data/v9.0/ExportToExcel
Headers{ "Accept": "application/json", "Content-Type": "application/json"}
Bodyjson{ "View": { "@odata.type": "Microsoft.Dynamics.CRM.savedquery", "savedqueryid": "5287b9ea-9947-45a6-b59f-8a32228db4a5" }, "FetchXml": "@{replace(outputs('Compose_FetchXML'), '\"', '\\\"')}", "LayoutXml": "@{replace(outputs('Compose_LayoutXML'), '\"', '\\\"')}", "QueryApi": "", "QueryParameters": { "Arguments": { "Count": 0, "IsReadOnly": true, "Keys": [], "Values": [] } }}

API call

Save the file

The output of the HTTP action is a file in base64 format.
You can use the Create file action to create a file in SharePoint: create file

The output is an Excel file with the requested data and columns: output

comments powered by Disqus
Empowering productivity - one blog at a time!