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 6).
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.0 to 1.0.0.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.
We provided the code used to create the custom actions present on the platform onĀ Github.
ļ»æ