How to assign multiple values to single key dictionary?

Hi , Team,
I want to assign multiple values to single dictionary key, in new version of UiPath not able to use Add to Dictionary and Add to collection activities .

see the pic for your reference
image

:ambulance: :sos: [FirstAid] Migration to Windows target Framework - Missing Microsoft.Activities.Extensions package - Dictionary Activities - News / Vote on Tutorials - UiPath Community Forum

You can’t assign multiple values to one key, but your value can be an array.

Did you create your dictionary variable as Dictionary(of string, list) or (of string, object)?

Yes I Have created dictionary variable

But what type of dictionary? Of String, Object? Of String, String? Of String, List?

And what is the problem? Are you getting an error?

then how to store multiple values in a single key

You can’t store multiple values in a single key. But a list is a single value. The list is the value.

Assign yourDict(“US”) = {“Texas”,“Florida”}

1 Like

Could you please suggest me the expession?

like this
image

Yes but you can’t copy/paste from the forum into activities. You’re getting the wrong double quote character. Make sure you type the expressions yourself, don’t copy/paste.

1 Like

I suggest making your dictionary

(of string, string)

because it’s simpler than list for this syntax. (that second term is “array of string”)

1 Like

But I’m still trying to understand your original post. Your “new list” syntax is correct. What is the problem?

Thank you so much Poul

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.