In this tutorial, you'll make a scope activity (for API authentication) and a standard activity (for API calls).
An activity is the building block of a process automation. UiPath Studio comes with various built-in Core Activities, as well as dedicated activities (PDF, mail, Excel) you can install through the Package Manager, depending on your needs. You can read The UiPath Activities Guide for more details and examples, as well as how to Manage Activities Packages. Additionally, you can create custom activities to better automate processes based on your needs. The steps below will give you the foundation to build custom activities in 5 minutes flat.
Open Visual Studio and click Tools > Extensions and Updates.
In the wizard that appears, click Online and then Search (
Ctrl+E) for UiPath. Download the UiPath Activity Set extension.
Close Visual Studio and, once the VSIX Installer appears, complete the installation.
Visual Studio organizes project files, settings, and build configurations into containers called Solutions. Go to File > New > Project (
Ctrl+Shift+N) to create a new solution.
In the New Project wizard that comes up, select Other Project Types > Visual Studio Solutions > Blank Solution and give the solution a name.
Notice that, in the Solution Explorer, a new solution has been made.
Click UiPath > Initialize UiPath Solution. This step adds the required build configuration files so your solution knows to package your project as a Nuget file, which is the format UiPath Studio expects activities to take.
Custom activities require a number of standard files organized in a specific way. Rather than add them all manually, right-click your solution in the Solution Explorer, and select Add > New Project.
Within the wizard that comes up, select Visual C# > UiPath > UiPath Activity Set and give your activity set a name (the conventional format is
<Company Name>.<Product Name>; UiPath.Orchestrator, for example).
Notice that 3 projects and many files have now been added to your solution.
With your 3rd project (in our example, MyCompany.MyProduct.Activities.Design) selected, click UiPath > Add .nuspec file.
This step adds the file that holds all the metadata for your activity, including its name, author, license, icon, etc. Feel free to change any of the values to match your package. Notice that some values, such as
id have the format
$title$. These are auto-populated from your project metadata contained in Properties > AssemblyInfo.cs and Properties > GlobalAssemblyInfo.cs, but can be overridden if desired.
Within the Solution Explorer, right-click your solution and select Rebuild Solution. You now have a working set of two activities!
In order to use your activities, UiPath Studio has to know where to find them. In the build Output, take note of the location of your newly created activity set. This will come at the bottom after
Successfully created package:.
Open UiPath Studio and navigate to the Package Manager's Settings. From here, tell Studio to look for new packages in the output folder copied from above. Once you click Add, you'll be able to see your new activity and import it into future workflows.
Once Studio has hooked into your output folder, add your activity set to workflow.
Notice that a new category has been added to the Activities pane.
Out of the box, you now have two activities to use: a Parent Scope and a Child Activity. More on those to come.