cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IPGeorgiev
Helper I
Helper I

Access Power Bi Report and export table in .csv

Dear All,

 

I was wondering if the following could be achieved using Power Automate Desktop:

 

Every day I need to open a browser, open Power Bi and load a specific report in Power Bi (I am not an owner of the report and I dont have access to the dataset) and then on one of the report pages I need to click on the three dots in the top right corner on the matrix there and click export data - > summarized data -> export as .csv and then save this file in a folder on my PC.

 

So while this doesnt take that much time , it something that happens on daily basis and I have to run the same for 4 different reports - so I was wondering if something like this can be achieved and automated via Power Automate desktop.

 

Many thanks in advance for the support!

 

Best regards,

Ivan

9 REPLIES 9
PhilipTreacy
Resolver I
Resolver I

Hi @IPGeorgiev 

 

I guess the short answer is yes this can be done. 

 

Have you used PAD at all?  Implementing the steps necessary will require starting a browser and navigating to the report.

 

Then clicking on the relevant parts of the site/screen is a matter of using Move mouse ...  steps.  Exactly which will depend on which ones work for the site.

 

Do you want to have a go and then come back if you get stuck on getting it working?

 

regards

 

Phil

Hi Philip!

Thanks for the response! I have progress - on Edge and Chrome I managed to reach the last step - clicking on the button to download the file, however there I get an error that download is not supported on Chrome/Edge and I should use the automation browser, however when I try with it - I doesnt open the Power BI Report - it just loads a blank page.


Any idea how to overcome this?

 

Many thanks!

 

Best regards,
Ivan

Does the download work on those browsers when you do it manually?

We have automated PowerBi report download using Power Bi Desktop application, it works basically the same way as via browser, you can also try that, if available.

Yes, when I try manually it works, So here basically I use the export data function on a matrix:

 

IPGeorgiev_0-1658925475846.png

 

And when this button is clicked the export starts, but power automate returns an error that it can only work with Internet Explorer or Automation Browser but it doesnt work with both of them as it cant even load the power bi page. It shows just a blank page.

 

It wont work via the Desktop App since I am not an owner of this report specifically, I am just an user of the report with access to specific range of the data.

 

Thanks a lot in advance!!

 

Best regards,

Ivan

rolign
Advocate II
Advocate II

I thought PowerBi Desktop displays the same data as in the browser, the link to the report remains the same.

Nevertheless - https://docs.microsoft.com/en-us/power-automate/desktop-flows/using-browsers Have a look at this link, are Chrome/Edge extensions set, updated? Maybe try removing, adding the newest version or so.

Hi @rolign ,

 

thanks a lot!

 

Basically Power Bi Desktop is only to build content, not to work with - I mean I cant load a dataset or a report I dont have access to (to the workspace/dataset) - at least I dont know how this could be achieved 

Thanks for the link - I have checked it and its all good with the Chrome extension - removed it and added it again , just for any case, however the issue might be something else - because I tried to see what will happen if I use "Click link on a web page" and select not the export but the cancel button and it still doesnt work:

 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Element with selector 'mat-dialog-container[Id="mat-dialog-0"] > export-data-dialog[Class="ng-star-inserted"] > mat-dialog-actions[Class="mat-dialog-actions"] > button[Class="mat-focus-indicator pbi-modern-button secondaryBtn cancelBtn exportButton mat-button mat-button-base"][Type="submit"]' not found. ---> Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.Exceptions.ElementNotFoundException: Exception of type 'Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.Exceptions.ElementNotFoundException' was thrown.
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.WebAutomationResultExtensions.ThrowIfError(WebAutomationResult result, String cssSelector, String option)
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.ClickBase.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.WebAutomation.Actions.ClickBase.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

Here what I setup:

 

IPGeorgiev_0-1658928631033.png

 

 

All other clicks are being executed, but only this one (click on Cancel or Export) triggers the error. 


Any ideas what I am doing wrong here?

 

Many thanks!

 

Best regards,
Ivan

rolign
Advocate II
Advocate II

Does the selector change if you capture it, reload the page, capture again or it remains the same? Not entirely sure what is going wrong here - any difference if you choose to click an image?

I tried to capture it several time, but no success. I tried for example to change it to click on the whole pop up window and it works but the Export, Cancel and X (close ) button in the top right corner - all 3 of them dont work for some unclear reason 😞

rolign
Advocate II
Advocate II

Just checked with colleagues that we do indeed use images and/or keystrokes to operate with those buttons, looks like you'll have to work out a combination with keyboard that works for this one. (Click, {Tab}, {Down} {Down} etc.)

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Top Kudoed Authors
Users online (4,801)