Dropdown Selection Property of Custom Activity

HI Friends,
I am developing a custom activity. While we are creating the “InArgument” Properties. It will appear a Property for the custom activity in the Studio. for declaring in the custom activity developement like “InArgument,InArgument,InArgument”. You can able see a textbox in the property window for the custom activity. But I want to know how to develop a property like selection. Below i have attached a sample.

image

Advance thanks
Balamurugan

7 Likes
 public enum ddEnum
        {
            Sunday,
            Monday,
            Tuesday,
            Wednesday,
            Thursday,
            Friday,
            Saturday
        }

        [Category("Input")]
        [RequiredArgument]
        public ddEnum getDayofWeek { get; set; }

image

21 Likes

HI @vvaidya,
Thank you. I was trying “public InArgument < ddEnum>” like this. I found my mistake.

Thank you
Balamurugan

2 Likes

How to get the selected value in code?@vvaidya @balupad14

1 Like

Hey @balupad14 @vvaidya,

I am trying to create a dropdown selection property as mentioned above and was also successfully able to see them in the UiPath studio using the above method. However i am not able to get the value of the property from the context to assign it for further use. Its just throws an error that the definition for ‘Get’ is not available.

Can you guys please explain how did you managed to assign the value within the Execute method.?

Thanks,
Rammohan B.

Hi @Rammohan91,

I think you have used the Enum for the dropdown selection . In that case, we don’t need to use the Argument attributes.So you can treat it as like a normal property.

Regards
Balamurugan.S

Brilliant

I got better idea hope it help others, you can look into activities using dotpeek decompiler

C:\Users\BaluVasireddy\AppData\Local\UiPath\Activities\UiPath.Core.Activities.18.1.6680.15559\lib\net452

have sneak peak into click activity you can see MouseButton

Cheers :beers:
Balu Vasireddy

6 Likes