cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DaveDodge
Frequent Visitor

UI Flow Fails Attempting to Launch Power BI

I've been testing launching Power BI in order to process a data refresh and re-publish of a report in Power BI.  Everything seems to be fine, the workflow is able to be processed and saved and looks fine in the workflow designer.  When I run the workflow, however, the Splash screen for Power BI appears to be launching as an instance of Power BI and this is confusing the UI workflow step to launch Power BI.  The workflow fails immediately after launching Power BI and the application is not "hooked" to further process down the workflow, even if you set to "Run after error".  The resulting error is listed below:

 

GeneralScriptExecutionError. Script execution failed with exception: System.InvalidOperationException: {"error":"unknown error","message":"Failed to locate opened application window with appId: Microsoft.MicrosoftPowerBIDesktop_8wekyb3d8bbwe!Microsoft.MicrosoftPowerBIDesktop, and processId: 13932"} at Microsoft.Flow.RPA.Agent.WinAppDriver.Components.WinAppDriverHost.<CreateSession>d__41.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Flow.RPA.Agent.Engine.Operations.RpaLaunchApplicationAction.<OnExecute>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Flow.RPA.Agent.Engine.RpaScriptExecutionEngine.<ExecuteActionOperation>d__8.MoveNext()

 

From previous experience working with WPF applications in Visual Studio, we had a similar issue with applications that had a splash screen and the workaround was to wait for a period of time to where the splash screen was no longer present and get the ID of the application from the actual launched application.  It does not appear that there is any way to modify the "Lauch" component of the UI flow so that could be accomplished.  Do you know of any other way to work around this or is it a known bug that is being addressed?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @DaveDodge,

 

Good catch. I was able to replicate the same error:

image.png

Indeed Power BI does seem to launch with a splash screen.

My advice would be to open a service request through the Power Platform Admin Center: https://admin.powerplatform.microsoft.com/support to further check this.

 

Thank you,

Ovidiu

 

View solution in original post

13 REPLIES 13
a-ovbord
Community Support
Community Support

Hi @DaveDodge,

 

Please check this link:

https://docs.microsoft.com/en-us/power-automate/ui-flows/edit-desktop

You could set the PT0S parameter to higher than 0 secs.

You can also include a Wait step after the screen load and see if it works.

 

Thank you,

Ovidiu

I had already attempted to do what you requested in your reply before I submitted this question.  It did not work, and I know why.  The reason the UI workflow fails for Power BI is because Power BI launches with a splash screen.  The UI workflow captures the ID of the splash screen, not the Power BI application, which is the target.  Since the remaining elements of the workflow require that the Power BI application be targeted by ID and the ID that was captured was that of the splash screen, the remaining elements of the workflow immediately fail, as they should, since the target applications ID is not in the workflow to work with.  If the splash screen and the Power BI application that results were both captured, the workflow would run properly.  If just the Power BI application ID was captured and not the splash screens ID, the workflow would run.  Neither one of these cases exist.  Hope that helps.

Hi @DaveDodge,

 

Good catch. I was able to replicate the same error:

image.png

Indeed Power BI does seem to launch with a splash screen.

My advice would be to open a service request through the Power Platform Admin Center: https://admin.powerplatform.microsoft.com/support to further check this.

 

Thank you,

Ovidiu

 

View solution in original post

Is it possible for you to forward this issue to the engineers since the support wizard told me that UI Flow is not supported during preview?  

Hi @DaveDodge,

 

I have already informed Engineering about this issue and as soon as I have news I will come back here and update the thread.

 

Thank you,

Ovidiu

RE: "The UI workflow captures the ID of the splash screen, not the Power BI application, which is the target..."


This sounds pretty logic. Subtle..., but a good catch indeed. I've experimented some UI Flow Preview Desktop scenarios on a
- mainly to see how deep I could get. In most cases, I preferred using specific Windows keys combination
whenever possible and avoid relying strictly on mouse clicks... 

One basic scenario was to launch Adobe Photoshop CS4 through a Windows combination keys (Ctrl+Alt+P) then run a previously defined Action script- which basically would pick all images located in a OneDrive "source" folder, resize and reformat all existing images and export them in a 2nd OneDrive "destination" folder using Save for Web and Devices option.
Everything went smoothly. No real problem there.

Another scenario (a bit more fancy one which I may not be recommended in real life production...) was to launch
Visual Studio 2019, create a new PowerPoint Add-In project. Surprisingly, running the UI Flow playback created a brand new project (with provided input "location project folder path" and "project name" variables). Still no huge problem there.
Every action sequence step was properly detected and pointed to right path.

Now dealing with Power BI Desktop was another ball game. I'm using the February 2020 version. No matter what, running UI Flow
playback would stall on splash screen. I then tried to simply deactivate the splash screen from being displayed on Power BI Desktop startup and see what I could come up with.

Splashscreen.png

The next time I relaunched Power BI Desktop the splash screen wasn't displayed on startup... Still no luck... Bang!!! Same error.
Also I don't know about you... but I found latest February 2020 installed Power BI Desktop version would randomly take some time
before enabling File menu. I don't know if an unwanted procedure is running in background I will have to check but it ain't
normal. Finally I don't feel quite comfortable with redundant "uninstalling and reinstalling" Power BI Desktop pattern.
So I guess we'll have to put the Power BI Desktop + UI Flow  RPA combination option on ice for a while... Too bad...

Hi @MawashiKid,

 

We have brought this behavior to the Engineering team and they have logged a bug and are currently working on it.

I will come here and update the thread once it is fixed.

 

We're also currently working on a workaround with Engineering and once I have a viable one I will update here.

 

So bookmark this page and check it for updates.

 

Thank you,

Ovidiu

Thanks for the quick reply. I will keep an eye open. 😉

Hi Ovidiu,

 

ICYMI Regarding a previous post, I wish to inform you that I managed to create a successful UI Flow Desktop scenario using a prior November 2019 version rather than February 2020 on 2nd laptop. It worked.
As I mentioned in previous post, instead of strictly relying on mouse events... I chose to use pre-defined Windows keys combinations whenever possible. I also had double checked existing assigned Ctrl+Alt+... combo list inventory in order to avoid any collision.... I could then used Power BI Desktop pre-defined menu key combo options (Alt+F, Shift+o,... and so on) instead of mouse events.
UI Flow detected and recorded each and every Power BI Desktop step - from launch to exit (including closing launching splash screen by simply clicking upright X button...) in a clean fashion.
Still I cannot bring you a final verdict that fully guarantees 110% the source of my issue was mainly related to February 2020 version splash screen bug. I mean a lot of things can and do happen in background during any software installation. I'm keeping an eye open 😉

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,841)