cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ernie-Velazquez
Helper I
Helper I

"Run Desktop Flow" and Output Browser Instance

Hi All,

 

I have about 15 different flows where the first step involves signing into a webpage before proceeding on running various other tasks.  That login page was just redesigned and i've decided to take advantage of the Run Desktop Flow action instead of updating the individual flows.  

 

My parent flow has the updated actions and elements for the new website, and I've created an output variable which i use the "Set Variable" to set to the browser instance variable generated when the chrome browser is open.  In the child flow, I run the desktop flow, and set it to create a variable.  However, when those subsequent actions need to click on the browser elements, I get the "Argument 'BrowserInstance' must be 'Web browser instance' error.  

 

Can someone point me to what i'm doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions

@Ernie-Velazquez 

 

You already in correct direction.

Currently "Run Desktop Flow" can not produce Output Variable "BrowserInstance", this is the limitation.

 

Solution is:

 

After you call your desktop flow login routine, combine it with action attach to browser using url.

You still manage the browser instance from the flow who call it but all code for login routine is in its own flow, so in the future you don't need to wasting your time editing your flow one by one if there is a css change in the website.

You just need to edit/update your login flow routine 1 time.

 

 

ps: - Make note of reusable action when designing a process. (a.k.a library)

View solution in original post

9 REPLIES 9
MichaelAnnis
Super User
Super User

My guess is your output is a text variable type, not a web browser variable type, so it's not identifying that.

 

I have the same instance.  Honestly, I think you would be better off having your entire login as a single subflow.  Then you you can just put this subflow in each flow, rather than have to call a completely different flow and deal with inputs/outputs.

Ernie-Velazquez
Helper I
Helper I

Thanks Michael.  I have it as a subflow (the logging in portion) in 15 other flows that accomplish different tasks, and that are triggered on different schedules.  Wouldn't I have to manually update those "logging in" subflows on each of the 15 flows?

Right, but it is 1 time, and you can copy and paste an entire subflow.  I'm actually doing it right now, and I have about 50 flows that all use this, but my LoginAPX subflow is the subflow I always use to Login to APX.  

But I simply fixed it once, and just copy and paste my entire subflow overwriting the existing subflow that I had:

MichaelAnnis_0-1644603804028.png

 

@Ernie-Velazquez 

 

You already in correct direction.

Currently "Run Desktop Flow" can not produce Output Variable "BrowserInstance", this is the limitation.

 

Solution is:

 

After you call your desktop flow login routine, combine it with action attach to browser using url.

You still manage the browser instance from the flow who call it but all code for login routine is in its own flow, so in the future you don't need to wasting your time editing your flow one by one if there is a css change in the website.

You just need to edit/update your login flow routine 1 time.

 

 

ps: - Make note of reusable action when designing a process. (a.k.a library)

Ernie-Velazquez
Helper I
Helper I

What a bummer, Run Desktop Flow seems like it would be perfect to prevent this.  Because next time the login screen changes you'd have to copy and paste the updated flow into those 50 flows again right?

 

Okay, I just got it to work by opening a new instance of chrome and then having it attach to the tab by title.  Should be a decent work around for now. 

He is right, an attach to web browser action should work in this scenario.

yeah, unfortunately, I'm on 2.8.  Run Desktop Flow doesn't exist.  😞

Ha!  I'd literally just said this was going to be my workaround for now.  Thanks Yoko, at least I wasn't totally far off.  Was hoping i didn't have to create that new attach to chrome instance...but better than nothing 🙂

@Ernie-Velazquez 

 

Tune your attach to browser action with retry 20 Times and wait 1

 

WebAutomation.LaunchChrome.AttachToChromeByUrl TabUrl: $'''google.com''' BrowserInstance=> Browser
ON ERROR REPEAT 20 TIMES WAIT 1
END

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Top Kudoed Authors
Users online (4,886)