Frontend Select decorator guide
5min
the select decorator allows you to select your inputs from a predefined list inside your custom action in the following example we will create a custom action that will allow us to calculate the sum of three numbers, two will be selected from a dropdown and a third one will be added manually 1\ first, you will need to handle the minimum requirements for your project by using the procesio nuget and editing the project file 2\ the libraries required by this custom action are using system; using system threading tasks; using ringhel procesio action core models; using ringhel procesio action core; using ringhel procesio action core actiondecorators; using ringhel procesio action core utils; using system collections generic; 3 create your custom action in a new class and configure the class decorator \[classdecorator(name = "name of action", shape = actionshape square, description = "description of the custom action", classification = classification cat1, tooltip = "tooltip of the action", istestable = false)] \[fedecorator(label = "configure formatting", type = fecomponenttype side pannel, tab = "presentation",parent = "side panel", rowid = 1)] \[permissions(candelete = true, canduplicate = true, canaddfromtoolbar = true)] 4\ implement the iaction interface 5\ create the variables that accept inputs from the list \[fedecorator(label = "first number", type = fecomponenttype select, tab = "input tab", options = "configp1optionslist", tooltip = "tooltip input1", rowid = 1)] \[bedecorator(ioproperty = direction input)] \[validator(isrequired = false)] public int input1 { get; set; } \[fedecorator(label = "second number", type = fecomponenttype select, tab = "input tab", options = "configp1optionslist", tooltip = "tooltip input2", rowid = 2)] \[bedecorator(ioproperty = direction input)] \[validator(isrequired = false)] public int input2 { get; set; } 6\ we will also create the third variable that will accept the manual input \[fedecorator(label = "third number", type = fecomponenttype number, tab = "input tab", rowid = 3)] \[bedecorator(ioproperty = direction output)] \[validator(isrequired = true)] public int input3 { get; set; } 7\ create the variable that will contain the sum of all three \[fedecorator(label = "result", type = fecomponenttype number, tab = "input tab", rowid = 4)] \[bedecorator(ioproperty = direction output)] \[validator(isrequired = true)] public int result { get; set; } 8\ create a list inside the custom action private ienumerable\<optionmodel> configp1optionslist { get; } = new list\<optionmodel>() { new optionmodel() { name = "value 1", value = 1 }, new optionmodel(){ name = "value 2", value = 2 }, new optionmodel(){ name = "value 3", value = 3 }, new optionmodel(){ name = "value 4", value = 4 }, new optionmodel(){ name = "value 5", value = 5 } }; each option is identified by a name and value that contain the value of the option 9\ inside the execute function we will decide what to do with the variables public async task execute() { result = input1 + input2 + input3; } 10 generate and upload the nuget 11 create the result variable 12\ drag the custom label on the canvas and link the actions 13\ select the custom action and enter the values in the input tab 14\ save , validate and run the process 15\ click check instances to view the result the code used to create the custom action can be found here