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 / 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
    12,982 Super User 2025 Season 2 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

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard