Implement multiple functions inside a single custom activity

How to implement multiple functions inside a single custom activity ?

Step by step guide

Multiple functions cannot be implemented inside a single class of a custom activity. This is because there is only one "Execute" method available inside a custom activity and this can be mapped to particular input and output values. Though multiple manipulations can be done inside a single "execute" method, when exported to a nuget package, it will only be visible as a single activity in UiPath and all the manipulations will act as a single process.

To have different independent functionalities in a single custom activity, the individual functionalities need to be implemented as individual classes inside the same project.

1. Create a custom activity as described as here

2. Once a class is added and the required functionality is coded in it, right click the project and add a new class as follows:

3. Give a different name for this class and remember to add the same namespace as provided in the first class. This is important, if the namespace does not match, the activity will not be visible in UiPath

4. Once the required functionality is added, export the class as a nuget package and import the same into UiPath as mentioned in the step 1.

5. Now, inside Uipath, you should see two activities under the activity section for the nuget package that was added: