Multiselect dropdown with variable field for enum flags argument types

Hi,

I’m building a library through the Visual Studio plugin and, for one of the activities, I’ve got an enum which I want my users to choose from.

Target behaviour
would be exactly what we’ve got in the modern design Click activity (UiPath.UIAutomationNext.Activities.NClick) where I can select multiple options from the list myself (via the GUI) or pass a variable

image

What I tried
I peeked into the code of the library and, at face value, it’s all the same as what I have in my project… It’s pretty much a standard InArgument there
image
image

I’ve got [Flags] on my enum too

    [Flags]
    public enum CompanyStatCategories
    {
    ...
    }

I tried with InArgument<> and without it.
With InArgument<> aroung the enum type I’m getting a plain text field for variable, with no dropdown.
image

Without InArgument<>

I’m getting a dropdown but with no variable field
image

Does anyone know how to get UiPath Studio to display both at the same time?

Thanks,
Filip

1 Like

Hi @Filip_C

There is a small change you need to include when you are setting the property, take a look at the bold text.

[LocalizedDisplayName(“CategoryOptions”)]
[LocalizedDescription(“PropertyKeyModifiers”)]
[LocalizedCategory(“PropertyKeyModifiersDescription”)]

public NKeyModifiers { get; set; }

All the bests in you custom activity project!

Andres

Hi @AndresTarazona,

Thanks for your response! I just got back to that topic since I wasn’t able to find any solution at the time.

I’m not sure I understand your suggestion.
The line in bold " public NKeyModifiers { get; set; }" seems to contradict what UiPath have done in their UiPath.UIAutomationNext.Activities.NClick activity
image

Besides, as I mentioned in the original post, I’ve tested both options with InArgument and without it.
Without the InArgument I get a dropdown with no field for variable, and with InArgument I get a variable field without the dropdown. Could you please elaborate, what change you were referring to, exactly?

Unless I’m missing something obvious here, I believe it’s related to the base class the activity inherits from. By default, activities generated with the Visual Studio extension inherit from the ContinuableAsyncCodeActivity class. UiPath’s activities that support that combine input (variable + dropdown), however, inherit from : TargetWithInputMode, IVerifyExecutionActivity which does not seem to be available in the Shared library that comes with the Visual Studio extension.
I tried to add the UiPath.UiAutomation.Activities to my project as a dependency and inherit from the class that way but it’s internal.

Thanks,
Filip