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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.