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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
tdoolittle
Frequent Visitor

Power Automate 'Export To File for Paginated Reports' Stop if Output is Empty

Hi,

I've spent a long time browsing various forums and use cases but I can't seem to find a solution for something that seems simple. Here are the steps of my cloud flow:

  1. Recurrence (output on a schedule)
  2. Export To File for Paginated Reports (create the output in PDF format)
  3. Create blob (V2) (drop the PDF file in an Azure blob endpoint)

Before step 3 occurs, I'm trying to find a way to check that the file that was created contains data, based on the underlying query that is executed in Power BI Report Builder. It seems there might be a solution to try to drop it in SharePoint first, then get the metadata to check the file size, if it's above a certain amount then move to the create blob step, and delete the temporary SharePoint file. But that seems ridiculous since the output is being stored within the flow before being saved to the blob, there surely should be some way to check the metadata of step 2 to determine if the output is going to be blank, and if so abandon the rest of the flow? Thanks!

1 ACCEPTED SOLUTION
tdoolittle
Frequent Visitor

After much searching and testing, I found a solution that works for me. Even though the steps appear to go in a certain order, the [Export To File for Paginate Reports] does not appear to hold the file temporarily somewhere, it directly exports into the target location.

 

The solution was to add steps after [Create blob (V2)] which do the following:

  • Under [Azure Blob Storage], [List blobs (V2)] at the [Create blob (V2)] location, which retrieves the metadata of all items
  • Under [Control], [Apply to each], which will create a for each loop on the result set of the [List blobs (V2)] step
  • Under [Control], [Condition], take the [Size] attribute from the [List blobs (V2)] step and check that it's less than the minimum file size in bytes
    • If true, then use [Azure Blob Storage], [Delete blob (V2)] and pass the [Id] attribute from the [List blobs (V2)] step
    • If false, then do nothing

View solution in original post

1 REPLY 1
tdoolittle
Frequent Visitor

After much searching and testing, I found a solution that works for me. Even though the steps appear to go in a certain order, the [Export To File for Paginate Reports] does not appear to hold the file temporarily somewhere, it directly exports into the target location.

 

The solution was to add steps after [Create blob (V2)] which do the following:

  • Under [Azure Blob Storage], [List blobs (V2)] at the [Create blob (V2)] location, which retrieves the metadata of all items
  • Under [Control], [Apply to each], which will create a for each loop on the result set of the [List blobs (V2)] step
  • Under [Control], [Condition], take the [Size] attribute from the [List blobs (V2)] step and check that it's less than the minimum file size in bytes
    • If true, then use [Azure Blob Storage], [Delete blob (V2)] and pass the [Id] attribute from the [List blobs (V2)] step
    • If false, then do nothing

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors