Use Microsoft Flow to archive PDF’s of your Paginated Reports in Power BI

With the recent announcement around E-Mail Subscription support for Paginated Reports in Power BI, you can now have full PDF’s of those reports sent to your inbox on a regular basis. This has been an ask for quite some time in Power BI, but many users have also been looking for the ability to subscribe and have these files delivered a specific location as well, like a OneDrive for Business folder. While we don’t have native functionality for that yet in Power BI, you can use Microsoft Flow to achieve this by taking the e-mail attachment from your inbox and moving it.  Here’s a step by step way to do just that.

First, go to https://flow.microsoft.com/ and do a search for “OneDrive”

The first result returned (for me, anyways) is “Save Office 365 email attachments to OneDrive for Business”

image

Select that, and you’ll see the following recipe –

image

It’ll confirm you’ve provided your credentials for both Office 365 Outlook and OneDrive for Business

image

At this point, you can simply hit “Create Flow” and be done if you wanted to.  However, if you do so, all attachments sent to your Office 365 inbox will be saved in a folder called “Email attachments from Flow”.  Instead, you might not want EVERY attachment in your inbox to go into this folder, but instead just the ones from your Power BI subscriptions, or maybe just a few specific subscriptions.  If that’s the case, we’ll need to make a couple quick changes.  Hit the “Edit” button at the top of the screen

image

The recipe will look like this right now

image

Click on the “Show Advanced Options” under new email.  You’ll see a number of new options you can set to narrow the criteria under which this Flow will run.

image

I’m going to set one where the Subject Filter is based on my e-mail subscription subject name

image

Now it’ll only be done for that particular subscription.  However, I’d like it to add the date to the name of the file so I can easily keep track of which PDF file is for which date.  To do that, I’m going to edit this item

image

by adding two new steps and modifying the “Create file” to append the date to the attachment name.  Add two “Compose” steps – in the first, add the attachment name.  In the second, add the following expression  –

concat(utcnow(‘yyyy-MM-dd’),’_’,outputs(‘Compose’))

Finally, change the “Create file” name to the Output of Compose 2.  This will change the file name to a combination of the date and the attachment name.   Once you’re done, your steps in the “Apply to each attachment” item should look like this –

image

And your entire Flow like this –

imageimage

To make sure it works, let’s test it out.  I’ve sent myself a sample e-mail

image

So I’ll run a Test clicking the “Test Icon” in the upper right-hand corner

image

And I’ll use the data from Office 365 Outlook, since I already have the mail in my inbox

image

The test runs, and says it has been successfulimage

Checking my OneDrive folder, I see that sure enough the attachment is there with the proper date format appended.

image

That’s all you need to do.  Just hit save, and it’ll automatically run against your inbox on an ongoing basis without any work needed on your part.

Microsoft Flow, in combination with Power BI Paginated Reports, provides a powerful way to save report snapshots or, with several additional file types soon to be available for your paginated reports subscriptions, data extracts, in a central location for you to easily archive and share.

Thanks for reading!

How Microsoft Forms, Flow and Power BI can reshape the classroom

image

If you read my last blogpost, you know I have two kids.  One is in middle school, while the other is in elementary school.  While certain things have gotten more modern for them compared to my time in school, many parts of their day to day activities have not.  For example, it always surprises me that my daughter is issued a laptop for the school year, but a large part of her testing is still done on paper.  The teacher then puts the scores in online, and if we want to see them, we have to remember to go and check a different website.  Sometimes the original test paper is never even returned.  It makes it hard to take action and help her focus her studies for the next test.

This is a major reason I was so happy to see Microsoft Forms released recently.  It allows teachers to make quizzes where students can answer questions and see right away what they got right/wrong and their score.   It’s incredible simple to get started –

1. Click “New Quiz”

image

2. Enter a Title (or optionally, a picture) and click “Add question” and which type of question

image

3. Enter the question details, marking things like which is the correct answer, whether it is required, etc.  Repeat until you’ve done creating questions.

image

4. Share it out to the students, or make a public link and share it with anyone!

image

If you’re thinking Google Forms does something similar, yes, I know.  But Google Forms doesn’t integrate with Microsoft Flow, while Microsoft Forms now does.  Now it’s possible to set up an e-mail alert to the parents/tutor/whomever and send the results when their son/daughter has finished the test.  Now before you scream “helicopter parent”, it’s important to keep this in context.  I wouldn’t expect to have the teacher do this for every test, or for every student.  But there are times where it could be quite valuable and a great way to drive action, vs. hoping that you go check/your kid tells you/etc.

To setup a new flow with Microsoft Flow, it’s really easy.  You open the Flow app from your Office 365 account and click “Create From Blank” –

image

Next, type “Forms” to see all the different items for Microsoft Forms you can trigger an action for –

image

After selecting that, I choose the form from the dropdown to create the Flow for –

image

I want to make it conditional based on the e-mail address entered for the first question.  I select “Add a condition” and the question I want to trigger the flow based on the student response –

image

Then I entered the condition parameter and value to match, and what to do if it matches –

image

I save the flow, and now I’ll get an e-mail when she finishes this quiz, along with her answers (if that is setup to be included).

image

This also allows me to do things like setup a Flow for inserting a new row in an Excel document when a student answers a question, etc.  That makes it easy to quickly analyze the results in Power BI and see the total points she got vs. total available points!

image

It took me less than a half an hour to create a quiz, create a flow, and view the results in Power BI.  I’m excited to see the potential there for students and teachers to take advantage of this.  Personally, I’m already thinking of some great new ways to I could see everyone use these tools and others from Microsoft to engage throughout the entire school year.

Thanks for reading!