<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marco Littel</title>
    <description>The latest articles on DEV Community by Marco Littel (@marconewspark).</description>
    <link>https://dev.to/marconewspark</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F432306%2Fceec86ac-af44-4b43-9600-4e7cb3e06fce.png</url>
      <title>DEV Community: Marco Littel</title>
      <link>https://dev.to/marconewspark</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marconewspark"/>
    <language>en</language>
    <item>
      <title>UiPath application to fill a webform from Excel (with Custom Activities) - Part I</title>
      <dc:creator>Marco Littel</dc:creator>
      <pubDate>Sun, 26 Jul 2020 08:59:04 +0000</pubDate>
      <link>https://dev.to/marconewspark/uipath-application-to-fill-a-webform-from-excel-with-custom-activities-part-i-459</link>
      <guid>https://dev.to/marconewspark/uipath-application-to-fill-a-webform-from-excel-with-custom-activities-part-i-459</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;In this 2-part article series, I'll be creating a UiPath robot that can be used to fill in the hours registration using an excel sheet.&lt;/p&gt;

&lt;p&gt;Our company uses a web-based timesheet application. Every week we have to fill in this timesheet, which requires logging into the application, filling in all the fields, adding comments where needed, etc.&lt;/p&gt;

&lt;p&gt;To practice my UiPath robot building skills, I've created a small robot that handles this for me. At the start of the week, I generate an Excel sheet in Office 365 by scraping all entries for this week from the web based timesheet application. &lt;/p&gt;

&lt;p&gt;At the end of each day, I fill in my Excel, and at the end of the week I run the UiPath robot to fill in the web based timesheet from the excel.&lt;/p&gt;

&lt;h1&gt;
  
  
  What will we be doing here?
&lt;/h1&gt;

&lt;p&gt;I'll be showing the following activities in this article series:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running a local version of the TimeRegistration Angular application by cloning my github repository, installing the dependencies, and serving it locally&lt;/li&gt;
&lt;li&gt;Creating a new blank process in UiPath Studio, and creating our first sequence to open the TimeRegistration application in Chrome
Using Visual Studio 2019 Community Edition to create custom activities for our robot&lt;/li&gt;
&lt;li&gt;Using UiPath studio to generate an excel file for the TimeRegistration application based on the current structure&lt;/li&gt;
&lt;li&gt;Filling in the time registration form by reading data from Excel and finding the matching row to fill in the data from Excel for that day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article will cover points 1 to 3; points 4 and 5 will be covered in the next article.&lt;/p&gt;

&lt;h1&gt;
  
  
  Applications used
&lt;/h1&gt;

&lt;p&gt;For the time registration application, I've created a simple Angular application that offers the same type of UI that our time registration application does. I'll briefly discuss running this on your own machine later.&lt;/p&gt;

&lt;p&gt;I'll be using Google Chrome as my browser. I've installed the UiPath Chrome Extension.&lt;/p&gt;

&lt;p&gt;For the UiPath robot, I am going to use UiPath Studio Community edition, version 2020.6.0.&lt;/p&gt;

&lt;p&gt;I'll be creating a few custom activities in UiPath to have my robot do what I want; for that I'll be using Visual Studio 2019 Community Edition and the UiPath Custom Activities Extension for Visual Studio 2019&lt;/p&gt;

&lt;p&gt;Office 365 is used for Excel handling; I have an Office 365 account that I can use; check my other article for instructions on how to link Office 365 to your UiPath Studio.&lt;/p&gt;

&lt;p&gt;All source control and versioning will be handled by Git and Github.&lt;/p&gt;

&lt;h1&gt;
  
  
  Angular Time registration application
&lt;/h1&gt;

&lt;p&gt;This application is a very flat UI application with no other logic behind it. It will generate an overview of some projects, and use the current week as starting point. Weeks start on Monday, end on Sunday. Goal is to prove that we can find projects in this list, based on an Excel input, then fill in the days for that project with the data in an Excel input.&lt;/p&gt;

&lt;p&gt;The Angular application can be found here. To run this, you will need node.js installed on your system, and to clone the repository you will need Git. Node.js can be found here. I used LTS version 12.18.2.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repository by opening a command prompt and typing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;git clone https://github.com/marcoNewspark/AngularTimeRegistration&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once cloning has been completed, we need to install the Angular modules and other modules we need. Go to the folder and type&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will install the necessary components (this might take some time).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;To see if the application is working, we can run it on our own machine by typing the following into the command window&lt;br&gt;
&lt;code&gt;ng serve&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open a browser (I use Chrome here), and navigate to&lt;br&gt;
&lt;code&gt;http://localhost:4200/weekDetail&lt;/code&gt;&lt;br&gt;
If the application is working correctly, it will show a screen similar to this one&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  UiPath - robot overview
&lt;/h1&gt;

&lt;p&gt;In UiPath, i'll be starting with a Blank process. In this process, the robot will contain the following parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Opening and closing TimeRegistration web application&lt;/li&gt;
&lt;li&gt;Using TimeRegistration to download an Office 365 Excel for filling in our hours this week&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Filling in the TimeRegistration fields based on our Excel sheet&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;UiPath - opening TimeRegistration&lt;br&gt;
First, we need to create a new project. Start UiPath Studio, and create a new blank process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The bot will be named &lt;strong&gt;TimeRegistrationBot&lt;/strong&gt;. I've included a small description, and specified what folder the bot will be created in.&lt;/p&gt;

&lt;p&gt;Clicking Create will set Studio to work creating the bot for us. After this is completed, we can continue by creating a folder for our TimeRegistration application. Right-click on the TimeRegistrationBot entry in the Project Explorer, and click on &lt;strong&gt;Add → Folder&lt;/strong&gt;. In the &lt;strong&gt;Add new folder…&lt;/strong&gt; window, enter &lt;strong&gt;TimeRegistration&lt;/strong&gt; and click on OK.&lt;/p&gt;

&lt;p&gt;Right-click the TimeRegistration folder in the Project tab, and select &lt;strong&gt;Add → Sequence&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Add sequence… window&lt;/strong&gt;, enter &lt;strong&gt;OpenTimeRegistration&lt;/strong&gt; and click on Create.&lt;/p&gt;

&lt;p&gt;In the Activities tab, search for Open Browser, and drag it into the Designer window for our new OpenTimeRegistration sequence.&lt;/p&gt;

&lt;p&gt;In the Open Browser activity, click the Insert url here field and enter the URL for our local time registration application surrounded by double quotes&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://localhost:4200/weekDetail&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Select the Open Browser activity, and change the BrowserType property to Chrome (nobody wants to use Internet Explorer…). Now, we can verify if it works from the bot as well, by clicking the Debug arrow in the Ribbon up top.&lt;/p&gt;

&lt;p&gt;A new Chrome window should open up, with our time registration application we just installed and which should still be running&lt;/p&gt;

&lt;h1&gt;
  
  
  Visual Studio 2019 - Creating custom activity project
&lt;/h1&gt;

&lt;p&gt;Now, we will be using Visual Studio 2019 to &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new UiPath Activity Project&lt;/li&gt;
&lt;li&gt;Add a new Activity via the Extension menu&lt;/li&gt;
&lt;li&gt;Create methods to generate the information we need&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd like to create a custom activity to generate a filename for me that Office 365 will use when creating an Excel file. This filename will have the following pattern:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Time registration &amp;lt;&amp;lt;dd-MMM-yyyy&amp;gt;&amp;gt; wk&amp;lt;&amp;lt;weeknumber&amp;gt;&amp;gt;.xlsx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I'll be using a custom activity that will generate this filename for me, based on the date argument input into the activity. This custom activity will have 1 input parameter &lt;strong&gt;inDate&lt;/strong&gt; that specified the date for Excel file generation. Based on that date, we will calculate the date of Monday for the week in which that date falls, and the ISO week number for that week. There will be 1 output parameter &lt;strong&gt;outFileName&lt;/strong&gt; with the generated filename.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the custom activity
&lt;/h2&gt;

&lt;p&gt;Open Visual Studio, and create a new project. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh2e6agu4n0vdiv30a81c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh2e6agu4n0vdiv30a81c.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the new project window, enter &lt;strong&gt;UiPath&lt;/strong&gt; in the &lt;strong&gt;Search for templates&lt;/strong&gt; textbox, and select the &lt;strong&gt;UiPath Standard Activity Project&lt;/strong&gt; template in the result list, then click on Next&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq4wbr29o8mccc374xob9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq4wbr29o8mccc374xob9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Configure your new project screen, enter the name for your library and the location where you want to store the sources on your machine, then click on &lt;strong&gt;Create&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv1b1wgem1oyp5coveqzx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv1b1wgem1oyp5coveqzx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the project has been created, select the &lt;strong&gt;Activities&lt;/strong&gt; folder in the &lt;strong&gt;TimeRegistrationApp.Activities&lt;/strong&gt; project in the Solution Explorer in Visual Studio. Click on &lt;strong&gt;Extensions → UiPath → Add Activities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy08o1upyax9a1eol12c0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy08o1upyax9a1eol12c0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Select a Method screen&lt;/strong&gt;, click on &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7l3u1f0xbzm1enimgcz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7l3u1f0xbzm1enimgcz9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Define activities&lt;/strong&gt; screen, click on &lt;strong&gt;Add (+)&lt;/strong&gt; to create a new Activity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi8dly2fefxpmw1wx0bd0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi8dly2fefxpmw1wx0bd0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Name&lt;/strong&gt; field, enter &lt;strong&gt;GetExcelDateFileName&lt;/strong&gt; as the name for our Custom Activity. Click on &lt;strong&gt;Description&lt;/strong&gt; field, and enter a description for our activities. Next, click on the button &lt;strong&gt;Edit&lt;/strong&gt; to edit in- and output parameters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyfy3ria29ormyyekth1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyfy3ria29ormyyekth1p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the in- and output properties
&lt;/h2&gt;

&lt;p&gt;In the &lt;strong&gt;Define properties&lt;/strong&gt; screen, click on &lt;strong&gt;Add(+)&lt;/strong&gt; to add a new property. Name it &lt;strong&gt;inDate&lt;/strong&gt;, set its type to &lt;strong&gt;System.DateTime&lt;/strong&gt;. Set the &lt;strong&gt;Required&lt;/strong&gt; property to &lt;strong&gt;True&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the same screen, click on &lt;strong&gt;Add(+)&lt;/strong&gt; and add a new property. Set its name to &lt;strong&gt;outFileName&lt;/strong&gt;, change its type to &lt;strong&gt;String&lt;/strong&gt;, and set the direction to &lt;strong&gt;Out&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F34en6cder0s555mh21h2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F34en6cder0s555mh21h2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;OK&lt;/strong&gt; in the &lt;strong&gt;Define Properties&lt;/strong&gt; screen, then on &lt;strong&gt;Finish&lt;/strong&gt; in the &lt;strong&gt;Define Activities&lt;/strong&gt; screen. Visual Studio will now create the boilerplate code for us to define our activity. To view this code, double-click on the &lt;strong&gt;GetExcelDateFileName.cs&lt;/strong&gt; file in the Solution Explorer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding our own code
&lt;/h2&gt;

&lt;p&gt;There are a lot of sections in this file, but for now we will concentrate on the Protected Methods section. Click on the + next to Protected Methods to open this section&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa4mjqalq648yib4puuuj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa4mjqalq648yib4puuuj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Find the section with the comment &lt;strong&gt;Add execution logic HERE&lt;/strong&gt;, and replace it with our custom code. Just above it, you can see our input parameter inDate, the date that we will use to start calculating start of the week and the weeknumber for that week.&lt;/p&gt;

&lt;p&gt;Algorithm: start of the week for us is Monday, end of the week is Sunday. So for the given date, determine the weekday and subtract a day until we reach Monday. Then use that date to determine the week number, by including a bit of code that calculates the ISO 8601 week number for a given date (google it for definition). We need to add a reference to System.Globalization for this code to work. &lt;/p&gt;

&lt;p&gt;End result looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protected override async Task&amp;lt;Action&amp;lt;AsyncCodeActivityContext&amp;gt;&amp;gt; ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
{
// Inputs
var indate = InDate.Get(context);
var workDate = indate;
var myWeekDay = workDate.DayOfWeek;
while(myWeekDay!=DayOfWeek.Monday)
{
workDate = workDate.AddDays(-1);
myWeekDay = workDate.DayOfWeek;
}
var myWeekNumber = GetIso8601WeekOfYear(workDate);
var myFileName = string.Format("TimeRegistration {0} wk{1}", workDate.ToString("dd-MMM-yyyy"), myWeekNumber.ToString());
// Outputs
return (ctx) =&amp;gt; {
OutFileName.Set(ctx, myFileName);
};
}
// This presumes that weeks start with Monday.
// Week 1 is the 1st week of the year with a Thursday in it.
private int GetIso8601WeekOfYear(DateTime time)
{
// Seriously cheat.  If its Monday, Tuesday or Wednesday, then it'll
// be the same week# as whatever Thursday, Friday or Saturday are,
// and we always get those right
DayOfWeek day = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(time);
if (day &amp;gt;= DayOfWeek.Monday &amp;amp;&amp;amp; day &amp;lt;= DayOfWeek.Wednesday)
{
time = time.AddDays(3);
}
// Return the week of our adjusted day
return CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(time, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, build the Custom Activity &lt;strong&gt;(CTRL+B)&lt;/strong&gt;, and when successful, publish the Custom Activity package to the local package repository location for UiPath. This path can be found in the UiPath Studio by clicking on &lt;strong&gt;Manage Packages&lt;/strong&gt; in the top ribbon, then clicking on &lt;strong&gt;Settings&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdq0saka3qbsjs5skhdz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdq0saka3qbsjs5skhdz0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy this path, then go to Visual Studio and right-click on the &lt;strong&gt;TimeRegistrationAppActivities.Activities&lt;/strong&gt; project. Select &lt;strong&gt;Publish…&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Publish&lt;/strong&gt; wizard, select &lt;strong&gt;Folder&lt;/strong&gt; and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;br&gt;
In the &lt;strong&gt;Folder Location&lt;/strong&gt; field, paste the value we just copied from UiPath Studio &lt;strong&gt;Manage Packages&lt;/strong&gt; settings and click on &lt;strong&gt;Finish&lt;/strong&gt;. Then click on &lt;strong&gt;Publish&lt;/strong&gt; in the &lt;strong&gt;Publish&lt;/strong&gt; window. Visual Studio will now generate a NuGet package that we can use in UiPath.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp05a6yy9kdhm016ojhku.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp05a6yy9kdhm016ojhku.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Verify the custom activity works
&lt;/h1&gt;

&lt;p&gt;First, we need to add our Custom Activity library to our UiPath project. Click on &lt;strong&gt;Manage Packages&lt;/strong&gt; in the top ribbon, then click on &lt;strong&gt;Local&lt;/strong&gt;. In the &lt;strong&gt;Search&lt;/strong&gt; field, enter &lt;strong&gt;TimeReg&lt;/strong&gt;. Our custom activity package should show up in the list. Click on it, then in the right part of the window, click on &lt;strong&gt;Install&lt;/strong&gt;, then on &lt;strong&gt;Save&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ab816ehyt0tefcu04z6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6ab816ehyt0tefcu04z6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;UiPath will add a dependency to the project, then close and re-open our Project. To verify that we can use the activity, create a new sequence in UIPath Studio. In the Activities tab in the designer, look for &lt;strong&gt;TimeRegistrationAppActivities&lt;/strong&gt; in the list. Open this entry, open the &lt;strong&gt;Activities&lt;/strong&gt; entry, then drag our &lt;strong&gt;GetExcelDateFileName&lt;/strong&gt; activity to our blank sequence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq64hfpctn8hxlf7h6z73.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq64hfpctn8hxlf7h6z73.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a new string variable &lt;strong&gt;outFileName&lt;/strong&gt; in our new sequence.&lt;br&gt;
Select the &lt;strong&gt;GetExcelDateFileName&lt;/strong&gt; activity in the Sequence designer. In the properties, we can enter our &lt;strong&gt;inDate&lt;/strong&gt; argument. Click on this field, and set it to &lt;strong&gt;DateTime.Now&lt;/strong&gt;. Now click on the &lt;strong&gt;outFileName&lt;/strong&gt; property, and enter &lt;strong&gt;outFileName&lt;/strong&gt; (no quotes).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4fwq5g8rbbton32a2f0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4fwq5g8rbbton32a2f0u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this, add a Message Box activity to our sequence. Set the Text property to &lt;strong&gt;outFileName&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Debug File&lt;/strong&gt;, and a message box should pop up with the filename that would be generated for today.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpxl3y5a8psrh7fn5wc7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpxl3y5a8psrh7fn5wc7e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Close the sequence we just created; you can delete the sequence in UiPath, we won't need it anymore. We've just proven that our custom activity works!&lt;/p&gt;

&lt;p&gt;In the next installment, I'll discuss running our web application, extracting our web application data into an Excel file, and using that Excel file to fill in the web application.&lt;/p&gt;

</description>
      <category>uipath</category>
      <category>visualstudio</category>
      <category>angular</category>
      <category>github</category>
    </item>
    <item>
      <title>Connect UiPath to your Office 365 account</title>
      <dc:creator>Marco Littel</dc:creator>
      <pubDate>Wed, 15 Jul 2020 11:35:19 +0000</pubDate>
      <link>https://dev.to/marconewspark/connect-uipath-to-your-office-365-account-4o45</link>
      <guid>https://dev.to/marconewspark/connect-uipath-to-your-office-365-account-4o45</guid>
      <description>&lt;p&gt;To help you set up a Office 365 account for UiPath robot access, here's a step-by-step guide (current as of July 2020).&lt;/p&gt;

&lt;p&gt;Before you can use your Office 365 applications in UiPath Studio, you need to create an app registration in the Azure Portal. This registration can then be used inside a UiPath Microsoft Office 365 application scope to authenticate to Office 365.&lt;/p&gt;

&lt;p&gt;In this guide, i'll show you how to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new App Registration&lt;/li&gt;
&lt;li&gt;Setup API permissions so your App Registration can use Office 365&lt;/li&gt;
&lt;li&gt;Add Office 365 Application Scope to your UiPath project&lt;/li&gt;
&lt;li&gt;Link up your App Registration to an Office 365 Application Scope in UiPath Studio&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Creating a new App Registration in Azure Portal
&lt;/h1&gt;

&lt;p&gt;Navigate to Azure Portal, and sign in with your username/password. This doesn't have to be the username/password that the robot will use.&lt;/p&gt;

&lt;p&gt;Next, navigate to Azure Active Directory using the left menu&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CJuLWcX5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/sJmDcRT.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CJuLWcX5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/sJmDcRT.png" alt="Azure Active Directory location in menu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Within Azure Active Directory, click on App Registrations:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QmLVYdAX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/opPAW4h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QmLVYdAX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/opPAW4h.png" alt="App Registration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the App Registrations screen, click on New Registration in the top menu&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MoZGt3xj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/DuRg60a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MoZGt3xj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/DuRg60a.png" alt="New registation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Register an application screen, enter a descriptive name for your app registration. I've used &lt;em&gt;UiPathOffice365Medium&lt;/em&gt; here.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BiXp_9cN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/mEKEMOk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BiXp_9cN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/mEKEMOk.png" alt="Imgur"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below that, we need to specify which accounts can be used with this app registration. Change this setting to Accounts in any organizational directory (Any Azure AD directory - Multitenant)&lt;/p&gt;

&lt;p&gt;Below that, there is a section for the redirect URI. This is quite important, and is part of the authentication protocol that is used here (OAuth 2.0). I'm not going to dive in the details of that (there are plenty of smarter people who can help you with that), but we can't leave the default value here as UiPath will not be able to work with this registration if we leave it blank.&lt;/p&gt;

&lt;p&gt;Set the type to Public client/native (mobile&amp;amp;desktop), and fill in the following value in the URI field; This is a pre-defined response in the OAuth2.0 protocol&lt;/p&gt;

&lt;p&gt;&lt;code&gt;urn:ietf:wg:oauth:2.0:oob&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vvZPL0jI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/wQVs5Q9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vvZPL0jI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/wQVs5Q9.png" alt="Redirect URI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, click on the Register button on the bottom part of the screen to create your new app registration. With that out of the way, let's configure the permissions for this new app registration&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup Azure Active Directory Permissions for our app registration
&lt;/h1&gt;

&lt;p&gt;After clicking Register in the last step, we should now be in the App Registration screen. In the menu on the left, click on API Permissions&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GhPRPmiE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jtc03vapv3fuu1j7uv31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GhPRPmiE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jtc03vapv3fuu1j7uv31.png" alt="API Permissions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Within the API Permissions screen, we first click on Add a permission.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rT489nBq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ylpo4jxlb1sxug8e573w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rT489nBq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ylpo4jxlb1sxug8e573w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A new screen opens, Request API Permissions. Click on Microsoft Graph. Within the Microsoft Graph screen, click on Delegated permissions.&lt;/p&gt;

&lt;p&gt;Next, we need to select the permissions. I'll list the section and subsection of the permissions you need to select&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calendar&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Calendars.Read&lt;/li&gt;
&lt;li&gt;Calendars.ReadWrite&lt;/li&gt;
&lt;li&gt;Calendars.Read.Shared&lt;/li&gt;
&lt;li&gt;Calendars.ReadWrite.Shared&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Files&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Files.Read&lt;/li&gt;
&lt;li&gt;Files.Read.All&lt;/li&gt;
&lt;li&gt;Files.ReadWrite&lt;/li&gt;
&lt;li&gt;Files.ReadWrite.All&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sites.Read.All&lt;/li&gt;
&lt;li&gt;Sites.ReadWrite.All&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Mail&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mail.Read&lt;/li&gt;
&lt;li&gt;Mail.ReadWrite&lt;/li&gt;
&lt;li&gt;Mail.Send&lt;/li&gt;
&lt;li&gt;Mail.Read.Shared&lt;/li&gt;
&lt;li&gt;Mail.ReadWrite.Shared&lt;/li&gt;
&lt;li&gt;Mail.Send.Shared&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you've selected all these permissions, click on Add permissions on the bottom of the Request API permissions screen. After processing for a while, your Office 365 App Registration is now ready for use with UiPath.&lt;/p&gt;

&lt;h1&gt;
  
  
  Add Office 365 Activities to your UiPath project
&lt;/h1&gt;

&lt;p&gt;To be able to use Office 365, we need to add the UiPath Office 365 activities to our project. First, start a new project, or open one in UiPath Studio.&lt;/p&gt;

&lt;p&gt;Once in your project, click on the Manage packages button in the ribbon.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ni7EAD3---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ycny1yy7nij0s70i0wnp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ni7EAD3---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ycny1yy7nij0s70i0wnp.png" alt="Manage Packages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Manage packages window, click on All Packages, then in the search bar enter &lt;strong&gt;Office365&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SjmQDVUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x05ozg2prf91k52xv8ql.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SjmQDVUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x05ozg2prf91k52xv8ql.png" alt="Office365 in Manage Packages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the results returned should be &lt;/p&gt;

&lt;p&gt;&lt;code&gt;UiPath.MicrosoftOffice365.Activities&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Select this activity, then in the right side of the Manage Packages window, click on &lt;strong&gt;Install&lt;/strong&gt;, then click on &lt;strong&gt;Save&lt;/strong&gt; in the right bottom of the window.&lt;/p&gt;

&lt;p&gt;UiPath Studio will now resolve the package and install it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Use the Office 365 Application Scope
&lt;/h1&gt;

&lt;p&gt;To use the Office 365 applications, we first need to insert an Application Scope in the project. To do this, navigate to the Activities tab in the Design window of UiPath, and search for the Office 365 Application Scope. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P4CYt2td--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/bSrj64i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P4CYt2td--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/bSrj64i.png" alt="a"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Insert it into a sequence. We will now configure connection to Office 365 from within this scope. To see the properties, select the Office 365 Application Scope in the sequence and let's have a look at the properties.&lt;/p&gt;

&lt;p&gt;There's a lot of options here, I won't go into detail on any of them now. But the only one we need to be able to develop with UiPath and Office 365 is the &lt;strong&gt;Application Id&lt;/strong&gt; property. We can copy this ID from the Azure portal, by opening the App Registration we created earlier and going to the Overview screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xUDJYWu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/622ubd1m2u65ry06q6uy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xUDJYWu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/622ubd1m2u65ry06q6uy.png" alt="Azure App Registration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The value we need can be found next to the Application (client) ID label (ending in 5f4 in my example). Copy the GUID displayed in Azure.&lt;/p&gt;

&lt;p&gt;In UiPath, create a new String variable applicationID, and give it a default value with the value we copied from Azure (quotes!)&lt;br&gt;
Next, in the properties window of the UiPath Office 365 Application Scope, set the variable applicationID in the Application ID field of the Office 365 Application Scope in our sequence&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LjR-BENN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/otci5t3wo23mlc8ns4h3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LjR-BENN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/otci5t3wo23mlc8ns4h3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, in the Services combobox, select the services you want to use. Most of the time, you're good with just using Files in this list (which will allow you to manipulate Office365 documents). Please refer to the UiPath documentation if you want to know more on this.&lt;/p&gt;

&lt;p&gt;Now we can run our sequence in debug mode, and UiPath will attempt to authenticate to Office 365. The first time we do this, we get a popup window where we will need to authorize to Azure/Office 365. Once we've authorized by logging in, we'll need to confirm the permissions we want to use&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wf2AZES8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3rju4x7n4a5p2u8kc7hq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wf2AZES8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3rju4x7n4a5p2u8kc7hq.png" alt="Permissions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll to the bottom of this list, and click on Accept (if you accept of course :)). Now, next time we use this application context we will be able to use it without authentication.&lt;/p&gt;

</description>
      <category>uipath</category>
      <category>office365</category>
    </item>
  </channel>
</rss>
