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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to pull in Column ...
Power Automate
Suggested Answer

How to pull in Column headers when dataset/body is empty?

(0) ShareShare
ReportReport
Posted on by 10
Hi All,
 
I'm am running a report that gets sent out every week.  I setup a simple flow that:
 
Queries a dataset in Power BI
Select statement to rename/order columns
Create CSV
Email it out
 
This works fine but some weeks there just isn't any data when it gets refreshed so the report errors out saying it can't email out an empty dataset.  Is there a way to pull in just the Column headers so that the report goes out with just those but no data?  
 
Thanks!
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    15,079 Super User 2026 Season 1 on at
    You can use the length expression to determine how many items are returned from your data set (Power Automate length() Function [How to Use] - Enjoy SharePoint). Use a condition with the length expression on the left side of the condition and set it to where it is greater than zero (0). Then put the rest of your actions under the yes side of the condition. When no items are returned, your flow will end.
  • CU05121516-0 Profile Picture
    10 on at
    Thanks for the reply but I think you misunderstood what I am asking.  I have a table that gets update weekly and usually it has 5-10 records in it - we'll say its for New Hires.  That queries through fine and outputs are pushed to the csv table and all is well - normally.  But some weeks there just aren't any new hires.  When this happens and the flow runs - it errors out on the Email step I mentioned above saying there is no data in the attachment - can't have that.  I want to find a way to still have the column headers come through.  
    So it normally looks like this:
     
    Name    Date Hire    Group.
    Jim         1/2/25         Accounting
    Bob         1/1/25        Electrical 
     
    Now if next week there are no people then no data is sent through the PBI Query and nothing gets passed to the CSV action.  What I want to see in this case is a CSV file that shows:
     
    Name     Date Hire      Group
     
     
    I still want to be able to send that to people so they know there were no hires this past week.  How do I do that?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 229 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 227

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard