Your first Custom action

7min

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
Document image
ļ»æ

5. In the Solution explorer right click on your project and select Edit project file and replace the text with.

XML
ļ»æ

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.

XML
ļ»æ

ļ»æ

6. Create your custom action in a new class.

7. Include the following namespaces in your Custom Action class definition.

C#
ļ»æ

8. We will provide you the full code for a custom action that will concatenate two strings that will be provided as inputs.

C#
ļ»æ

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
Document image
ļ»æ

11. From the Visual Studio main menu selectĀ Build SolutionĀ from theĀ BuildĀ dropdown.

Document image
ļ»æ

13. To add the Custom action to your project switch to theĀ Custom actionsĀ section.

Document image
ļ»æ

14. Click theĀ Create custom actionĀ button on the bottom left corner.

Document image
ļ»æ

15. Give the action a name and upload or drag and drop the file and clickĀ Save.

Document image
ļ»æ

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.

ļ»æ