Desktop UI Flows – automate your legacy applications!

Following up on my previous blog about automating web apps with UI Flows, it’s time for legacy applications. I will show you how desktop UI Flows for windows applications can automate manual entries in legacy systems.

Imagine you are a call center agent and a new customer is calling to place an order. You enter their contact information and order details in your modern CRM system. However your organization still has a legacy order delivery system. Therefore you need to enter all information regarding their order again inside that application.

This can now be automated using Power Automate UI Flows! I record a UI Flow to enter contact information into this legacy system. A regular Flow inside a model-app starts the UI Flow. After the desktop UI Flow creates the contact in the legacy system a unique identifier is created. We grab the unique identifier of the just created contact. And as a result we can add this to our contact record in the Common Data Service. Let’s check out more details.

Scenaro description of the attended UI Flow automating legacy desktop application
Attended UI Flow scenario

Old ugly legacy app

Now I do not have such a legacy application to play around with. Luckily I am a developer by day and thus could create such a legacy application. I present to you the Old Ugly Legacy App. I am very proud of this creation and I want to share this with you! No really, it is on my github here. Not because it’s useful, but you might want to play around with UI Flow yourself and are not a developer. Feel free to use this app.

Old ugly legacy app to demo UI Flow capabilities
Old ugly legacy app to demo UI Flow capabilities

This application mimics a contact form. With a typical form you add a contact to this legacy system. After saving the contact the record will get a unique identifier. This auto number represents the contact. Of course we want to know about this in our CRM system! Luckily grabbing an output parameter is easy, as you can see in the following video:

Get output of the app to use in next steps in your flow

Recording your steps in desktop UI Flows is easy!

To start recording, take a look at the documentation provided by the Power Automate team. I love how integrated the experience is in the Power Automate Portal. It feels very familiar and even without looking at the documentation you will be on your way recording in no-time. Of course I do want to give you a few pointers:

  • Start the automation by highlighting your legacy desktop application. Do this by pressing the title bar. This will make sure the app has focus when the automation starts.
  • After you are done recording, manually add a close application step to your automation. UI Flow starts the application on startup so close it to avoid having too many instances open.
  • Currently not all keyboard layouts are supported. So if you are using a layout not available in this list, you need to switch before recording. During playback the keyboard used for recording also needs to be selected.
Switch your keyboard layout to english.
Switch your keyboard layout to english.

On-demand flow in your model-app

As I explained in my blog about automating web apps, use API’s and connectors as much as possible when automating. Only use UI Flows when you have no other option. Using Power Automate Flow we trigger the UI flow. Inside the model-app the user can choose which contact to add to the legacy system. The flow is very basic. Choosing the trigger ‘When a record is selected’ on a contact the attributes are available. Use these attributes to run the attended UI Flow.

Power Automate Flow triggered in the model-app
Power Automate Flow triggered in the model-app

When the UI Flow finishes, the output variable is available to use in the next action. Update the contact attribute Legacy App Number with the legacy application auto number and that’s it! We now have automated a process which a user normally has to do by hand.

Update the contact inside CDS with the legacy autonumber
Update the contact inside CDS with the legacy autonumber

See this short clip below to see this in action:

Attended UI Flow Scenario in action

In this scenario we manually start the automation process by pressing the Flow. Of course another option would be to trigger the flow on create of a contact record. However in that scenario it would be better to use the unattended feature of UI Flows. A bot on a virtual machine will perform the automation.

Final thoughts

Although this is a simplified solution of the scenario I described in the intro, it shows the power added to the platform. In short if you have legacy systems in your enterprise, desktop UI Flows will help you. It improves productivity by freeing end-users with less administrative tasks. Also it will help quality as humans are error-prone when performing mundane tasks.

I prefer using unattended UI Flows though. Using an attended UI Flow will use the system of the user. Using the mouse and keyboard during play back of the automation will result in failures. Choosing unattended UI Flow will also allow to scale the automation to multiple entries if needed.

Leave a Reply

Your email address will not be published. Required fields are marked *