Issue with Dictionary field. It is disabled in UiPath

custom_activities
arguments

#1

I have created following class in c# Library, which is imported in UiPath as NuGet package.
InputTable with collection is disabled as shown in the attached screenshot.
Kindly let me know, how to enable this field so that user can click the “…” and fill the collection.

public class TableFields : CodeActivity
{
[Category(“Input”)]
[Browsable(true)]
[RequiredArgument]
public Dictionary<string, Argument> InputTable { get; set; }

    public TableFields()
    {
        InputTable = new Dictionary<string, Argument>();
    }

    protected override void Execute(CodeActivityContext context)
    {
        throw new NotImplementedException();
    }
}

image


Custom Activity: Collection as Input Argument
#2

Did you find a solution for this? I am having the same issue right now


#3

Hi @llavieri and @deepak1745,

Can you try like this …

image

    [Category("Input")]
    [Description("Dictionary")]
    [DisplayName("Dictionary")]
    [Browsable(true)]
    public InArgument<Dictionary<string, Argument>> DictionaryItem { get; set; } = new Dictionary<string, 
     Argument>();

Regards
Balamurugan.S


#4

Hey thanks. But, how can I Initialize that dictionary? Can you give me an example?

I tried:

New Dictionary(Of String, Argument) From {{ "", System.Activities.Argument.Create(Of String, System.Activities.ArgumentDirection.In)}}

But it throws an error: Type System.Activities.ArgumentDirection.In is not defined