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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors