Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Problem with How to Create CSV table to include data obtained from Run a query against a dataset

Hi everyone,

 

I am attempting to create a flow which builds a csv file, based on a step which queries a dataset, and then send the csv as an email attachment.

 

I can get it to create the csv and send the email with the csv attached but the csv content only shows a count of rows, not the actual row data. This is all quite new to me so I guess it is because I do not have an array set up correctly to then split out custom rows as I saw on an online tutorial on this topic.

 

My flow queries the dataset successfully and then parses the JSON into FirstTableRows using the schema. However, when I later get to the Create CSV table step, I don't have access to the row variables that I need to populate the csv with....

 

Please can someone let me know what I am missing here ?

 

Many thanks !

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You are missing a couple of steps here. To "send the csv as an email attachment"  you first need to materialize the CSV into an attachment. 

 

Instantly using Power Automate create CSV file and send email attachment - Global SharePoint (global...

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

You are missing a couple of steps here. To "send the csv as an email attachment"  you first need to materialize the CSV into an attachment. 

 

Instantly using Power Automate create CSV file and send email attachment - Global SharePoint (global...

Anonymous
Not applicable

Hi @lbendlin 

 

Thanks for your input.

 

In my case I don't have Sharepoint but get the data from a dataset query.

 

So I have added in a step to Initialize variable of type Array as Name varFileAttachement.

 

Then after the Create CSV table action, I added in Append to array variable which adds the Output from Create CSV table to varFileAttachment.

 

Then in Send an email (V2) I have added varFileAttachment as the Attachment.

 

The flow runs but the email received has no attachment - what am I missing ?

 

Andy_W_UK_0-1730285843237.png

 

Thanks

Step 8 in the document I linked to is the main step. Everything else is just prep work that you can replace with your own.

 

- Run query

- generate CSV table

- specify attachment name and content

- add attachments array to email

lbendlin
Super User
Super User

You are missing a couple of steps here. To "send the csv as an email attachment"  you first need to materialize the CSV into an attachment. 

 

Instantly using Power Automate create CSV file and send email attachment - Global SharePoint (global...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.