Your first Custom action
In the following article we will learn how to create a simple Custom action and how to add it to our flow.
1. Open Visual Studio.
2. Create a New project of type Class Library (.Net Core 3.1).
3. In this example we will call the action FullName.
4. Add the nuget to your project:
- go to Tools → Nuget Package Manager → Manage NuGet Packages for Solution
- from Package Source select your Github connection
- from Browse select the Ringhel.Procesio.Action.Core package
- check the name of your project and click Install
5. In the Solution explorer right click on your project and select Edit project file and replace the text with.
If you choose to use the following optional tags, you will need to update them manually when you create a new build in the same way as you update the Version tag or the changes will not appear in the new build.
6. Create your custom action in a new class.
7. Include the following namespaces in your Custom Action class definition.
8. We will provide you the full code for a custom action that will concatenate two strings that will be provided as inputs.
You have the following class attributes that if set as true will give your action extra functionality, we advise that you set them to true. If the CanAddFromToolbar is set as false in your code the action will not appear in the platform.
9. The above code can be altered to create your own specific custom action or left as is.
10. To generate your own nuget you will need to right click your project in the Solution explorer and select Properties and in the Package section you will need to:
- check Generate Nuget package on build
- before each build you will need to come here and change the Package version, for example from 1.0.0 to 220.127.116.11.1
11. From the Visual Studio main menu select Build Solution from the Build dropdown.
13. To add the Custom action to your project switch to the Custom actions section.
14. Click the Create custom action button on the bottom left corner.
15. Give the action a name and upload or drag and drop the file and click Save.
16. The newly created Custom action will appear in the Custom actions list and you can drag it on the canvas like any other action.