cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Squared using MS Flow and UiPath

Background on UiPath: If you are aware of what RPA and UiPath are please feel free to skip to the next section. In this section I will give you a small background of what RPA is and how we can build RPA solutions with UiPath. RPA is an acronym for Robotic Process Automation and RPA is the use of software integrated with out of the box capabilities such as machine learning, automated recorded action steps, artificial intelligence etc. to ease repeated tasks such as data entry, handling, scraping, transaction processing etc. The UiPath RPA platform provides us with the capability to build processes and automations that can be used to achieve RPA processes such as automating manual repetitive processes. More at UiPath RPA

In this article I will show you how we can create a simple automation process in UiPath and trigger that automation from MS Flow. We will run an action in Flow and based on the outputs of that, we will pass parameters to the UiPath process and trigger the robot through the UiPath Orchestrator API and achieve the desired automation. More on UiPath Orchestrator API : UiPath Orchestrator API Reference

Let us consider the time card logging task for this automation. ‘A’ is an employee of the ‘XYZ’ organisation. ‘A’ has to log their time card every day and the process is generally to log into the time card portal -> navigate to the timecard page -> select the task and fill up the effort for the task -> save and submit the time card. Considering this problem statement, I divided the automation task into two parts.

1. Performed by Flow: I created a flow where, ‘A’ will just have to select the Task code and the number of hours in the Flow trigger -> Flow will then authenticate to the UiPath orchestrator through an API call (HTTP POST request) -> Flow retrieves the authentication token and gets the process key through another API call (HTTP GET request) -> Flow now uses the authentication token, the process key and the user input to start a job that triggers a robot to run the automation process on the user machine (HTTP POST request).automationSquared2.png

2. Performed by the UiPath Robot: In the UiPath studio, I created a state machine process that has multiple states. Once triggered, the first state is to login to the time card portal using the credentials of ‘A’ (hardcoded in this process) -> once the login is successful, the robot extracts the task code sent as an input argument from flow and compare that with a pre-populated task code. Upon matching the task code, the robot now starts the process of navigating to the time card and selecting the requested task code and filling in the hours (sent as an input argument from the flow trigger). Once done, it saves and submits the form, clicks a screenshot and sends a confirmation email to ‘A’ along with the screenshot. In an event where the task code is not recognised, the robot terminates the process by directly sending an email to ‘A’ stating the invalid task code error reason.automationSquared.png

Although most of the hard work in this scenario was done by the UiPath RPA process, my intention through this post is to show a seamless integration between the two tools using the HTTP action that can automate about anything. This was a simple web recording type scenario but imagine situations where you have custom desktop applications that are accessed through VM’s under various environments. The UiPath studio provides with a capability of automating processes inside of VM’s under Citrix environments and once connected to the UiPath Orchestrator, these processes can be executed based on triggers, actions and plans that are configured in Flow.

I hope you found this interesting and it helped you. Thank you for reading!

Comments

Does flow requires SSL cert that are authorized by global cert authority?

Put another way, will it work with locally authorized domains (.local) ?

Hey @Keegan 

 

Do you mean that you have the UiPath Orchestrator running on your private network (I mean to ask have you installed it on an Azure service or something that you can access it on the internal endpoints only?)

 

If so, I am not sure if we can send a direct HTTP request to internal endpoints as the external traffic will be blocked. I have never used the UiPath orchestrator or the robot that way as it needs a premium license. 

 

Currenlty, the team is probably working on including a proper connector for UiPath with flow. You can upvote the idea and add a few lines here too: https://powerusers.microsoft.com/t5/Flow-Ideas/Connect-to-UiPath-RPA-Tool/idi-p/295138

 

Hope this Helps!

 

Thanks, 

Hi @yashag2255 ,

 

Thanks for your reply. I did suspect that is the case. 

In this instance, we originally wanted to keep the access private so have only configured the UiPath Orchestrator with a .local domain. Then we realize Microsoft Flow service runs externally so unable to resolve the hostname of the Orchestrator.

Cheers

 

I can't seem to insert the "result" from the authenticate step to the following http activities easily. 
There was only "body" available. 

Adding "Parse JSON" in between does allow me to extract the "result" from the "body" though. 

Hey @Keegan , The Orchestrator REST API has changed a bit after this blog was written. Note: You will not get the 'result' as a dynamically selectable attribute. Once authenticated, please go to the run history and check the output. Here you will find the result in JSON and then in the flow, you need to either use parse JSON or write an expression to get to the result attribute. 

 

Hope this Helps!

Hey @Keegan 

 

Here is the expression I used to get the result: 

body('Authenticate_UiPath_Orchestrator')['result']

This gets the authorisation token. 

 

Here, Authenticate_UiPath_Orchestrator is the name of the Send and HTTP request action. 

 

Hope this Helps!

Thanks @yashag2255 . Much appreciated.

Meet Our Blog Authors
  • Working daily with Microsoft Cloud to deliver the needs of my company, my customers and various Microsoft communities and forums. | Office 365 | Flow | PowerShell | PowerApps | SharePoint |
  • Co-founder of https://plumsail.com, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc ( https://triad.co.uk)
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor