Power Automate Desktop Example - Downloading Image From Email To Network Drive
After watching the RPA (Robotic Process Automation) demo from Steve Winward Real-Life Use case using AI Builder Form Processing with Power Automate Desktop I have been looking for ways to utilize Power Automate Desktop Flows in order to make my life a little easier. Yesterday like every day I started clicking through the emails that I receive from my kids schools. I open each email, download the image, then move the image to a network drive on my computer. This takes me a few minutes every day but my kids are worth it :) This scenario was a perfect one for me to automate using Desktop Flows since they can access the network drive on my desktop.
The basic flow of the solution will be as follows:
- A Power Automate Cloud Flow will be triggered to run whenever a new email comes into my Gmail account with a specific tag.
- The Cloud Flow will gather up all the information needed to run the Desktop Flow
- The Cloud Flow call the Desktop Flow by connecting through an On-Premise Data Gateway that is installed on my desktop.
- The Desktop Flow will download the image and save it to my network drive.
Prerequisites
In order to complete all this you will need the following.
- Power Apps Environment. If you don’t have one you can try it out by signing up for a Developer Plan here.
- Power Automate Desktop. This needs to be installed on your computer, download it here.
- On-Premise Data Gateway. This is how the online Power Automate cloud flows will connect to your Desktop Flows. You can download it here. Instructions for installation can be found here.
- Application registration for Gmail within the Google console. You cannot use the default shared application because it’s not compatible with the Encodian actions or any other external Flow actions. Learn how to create this here.
- API key for Encodian to utilize their Regex action in your flow. You can sign up for one here
Inspecting the Email
For this example I’m using emails supplied by a service called Tadpole which my kids school uses to send out images and notification. The first thing I had to do was use the developer tools (F12) within the browser to help me understand how the urls were formatted for the service and how they worked. After searching through the html I figured out the formatting and found that if i used one of the parameters found in the one link for d=t that it would download the full size image.
Add Gmail Label and Filter
The first thing i did was went into my Gmail and created a new label for the incoming emails. The name of the service the school use is Tadpole so i made that my label. I think created a filter so that all emails coming from the Tadpole address would get that label applied. All of this is important because otherwise your Flow will run on everything in your Inbox which could be a lot of messages and you could end up running into API limits for Flow depending on your license.
Create the Desktop Flow
The desktop flow will download the image using it’s url and save it to to the network drive. To get started open the Power Automate Desktop application you have installed and create a new Flow.
The first thing we need to do is define the input variables we will use. We will later be passing the data into these variables from the Cloud Flow created later.
Now we can start adding actions to the Desktop flow. The first one will be a Convert text to datetime action which we will use to transform the input variable from the flow into a datetime which will allow us to do some string formatting faster.
Next we will do some formatting on our date time to create flow variables which we will use later.
Check to see if the network drive folder exists and if not create it.
Finally we will download the file using the url provided as an input variable and save it to our network drive folder.
We have now successfully created our Desktop flow. Make sure you save it and then you can test it by clicking the Run button in the editor.
Create the Cloud Flow
Now that we have created our Desktop Flow we need to run it any time an email arrives in our Tadpole inbox. This flow also needs to extract the rrl for the image and pass that information to the Desktop Flow.
Here is a high level outline of the Flow we are going to build.
Now let’s get started building! We will start by creating a solution in the maker portal.
Add a new Cloud Flow.
Setup for our Gmail trigger. Again if you haven’t created a new Application within the Google console you should do that now using the instructions located here.
All the emails that contain images have kids names at the beginning of the subject so i will set up a condition to make sure that this is an image email and also extract that data so i can use it to save the image later.
We need to get all the urls contained in the email so we will use the Encodian Regex action here to find them. Here is the Regex you will need to find all the urls in the body of the email.
(?:(?:https?|ftp):\/\/|\b(?:[a-z\d]+\.))(?:(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))?\))+(?:\((?:[^\s()<>]+|(?:\(?:[^\s()<>]+\)))?\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))?
Now that we have all the urls in the message we need to look at them all and see which one is the image. We will also do some parsing of the url to make sure we get the full size image by appending the ?d=t property to the url.
Last but not least we will connect to the Desktop Flow we created earlier and pass in all the information we have collected from the email.
Test It!
In order to test my flow I added another Gmail filter that would tagged any email coming from myself with my kids names in the subject. This allowed me to then forward old email to myself for test processing.
Wonderful blog to check out and reference links also related to the topic.
ReplyDeleteDevOps Training in Chennai
DevOps Online Training
DevOps Training in Bangalore
Great Post!!! Thanks for the data update and waiting for your new updates.
ReplyDeleteDOT NET Training in Chennai
Dot net Training Online
Dot Net Training in Coimbatore
Glad to visit this blog, really helpful. Gathered lots of information and waiting to see more updates.
ReplyDeleteRPA Training Institute in Chennai
RPA Certification Course
RPA course in Coimbatore
RPA Analyst
I found your blog on Google and read a few of your other posts. I just added you to my Google News Reader. You can also visit RPA Companies In India for more Webuters Technologies Pvt. Ltd. related information and knowledge, Keep up the great work Look forward to reading more from you in the future.
ReplyDeleteI like this article. It is very good to read. Keep updating.
ReplyDeleteAccounting Software Singapore
PSG Grant Accounting Software
E invoicing Singapore
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Zendable
ReplyDeleteExcellent Blog, I like your blog and It is very informative. Thank you
ReplyDeleteRPA Online Course
Pega Online Course
Ranorex Online Training
Nice article, its very informative content..thanks for sharing...Waiting for the next update.
ReplyDeleteDrupal Training in Bangalore
Drupal Course in Bangalore
Really an informative blog...Thanks for sharing an informative article with us.
ReplyDeleteIoT Training in Chennai
IoT course in Chennai
valuable blog,Informative content...thanks for sharing, Waiting for the next update...
ReplyDeleteCoded UI Online Training
Coded UI Training Online
Thanks for taking your valuable time to share this awesome article with us. This is really informative. Looking forward to learn more from you.
ReplyDeleteCloud Computing Training in Chennai
Cloud Computing Online Training
Cloud Computing Course in Coimbatore
Nice Blog, it is very Impressive.
ReplyDeleteRPA Online Course
RPA Course in Chennai
RPA Course In Bangalore
Great info. The content you wrote is very interesting to read. This will be loved by all age groups.
ReplyDeleteDevOps Certification in Chennai
DevOps Training Online
DevOps Certification in Ciombatore
Great Blog with Good Information.
ReplyDeleteRPA Training Online
RPA Training in Chennai
RPA Training In Bangalore
Great Article!!! Waiting for the new updates.
ReplyDeleteSelenium Course in Chennai
Selenium Online Course
Selenium Course in Coimbatore
Great Blog with good information.
ReplyDeleteCoded UI Online Training
Coded UI Online Course
Machine Learning Projects for Final Year machine learning projects for final year
ReplyDeleteDeep Learning Projects assist final year students with improving your applied Deep Learning skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include Deep Learning projects for final year into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Deep Learning Projects for Final Year even arrange a more significant compensation.
Python Training in Chennai Project Centers in Chennai
Nice blog, keep sharing with us.
ReplyDeleteDrupal Course in Chennai
Drupal Course in Bangalore
Nice blog, it is very impressive.
ReplyDeleteDifferent Types of Internet of Things
Types of IoT
Great blog with good information.
ReplyDeletePega Training in Chennai
Pega online Training
This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: network cabling installers
ReplyDeleteUseful blog, keep sharing with us.
ReplyDeleteThe Structure of Pega Application
Application Structure of Pega
this was an awesome blog . thank you for sharing this konwlwdge with us.
ReplyDeletepega online training
pega training
https://www.capchirurgie.com/don-ovules-chypre/
ReplyDeleteI found one successful example of this truth through this blog. I am going to use such information now. NEC Phones Brisbane
ReplyDeleteUseful content, keep sharing with us.
ReplyDeleteCorporate Training Tips
How to be a Better Trainer for Your Employees
Faboulse work with good content thanks for sharing!!
ReplyDeleteSQL Injection Work
SQL injection
This article is so good and informative thanks for sharing this content Stock Fraud USA
ReplyDeleteI prefer high-quality content, which I discovered in your article. The information you've provided is useful and RPA Training Pune important to us. Continue to post articles like these. Thank you very much.
ReplyDeleteGREAT POST https://edgarozlq275.edublogs.org/2022/09/05/20-questions-you-should-always-ask-about-hot-stocks-before-buying-it/
ReplyDeleteThe 2D and 3D pictures are generally used to have an enhanced visualization in sites and in some cases in sight and sound introductions.
ReplyDeleteclipping path service
great post , keep posting valuable information Software Testing Classes in Pune
ReplyDeleteYou've written a very detailed post regarding..... This information is useful to me and is also beneficial to people who...... I appreciate you providing this information.mobile app development
ReplyDelete