Choosing a single string from an array of strings with dropdown list in Assign Activity

Hey @Nithinkrishna

I don’t know how to do that. Can you show an example?

1 Like

Hi @private_matter ,

You can also create one template.
And then read it and store it in Dictionary in the same way we do for Config file.

This approach will be dynamic, if in future you want to add new value then just add it in excel file

1 Like

This is perfect @ermanoj3101

Could you please try this @private_matter

1 Like

@ermanoj3101

I don’t like to use external sheets like excel. I prefer if the dictionary is stored within my .xaml file.

1 Like

You can do that also but it will not be dynamic, in future if you need to add some values you have to go to code and then publish package again.

It’s your choice , then use dictionary.

Thanks.

1 Like

Hey @private_matter

Please find this workaround below…

PFA - Dictionary.zip (2.1 KB)

You can even use new Date(01,01,2016).Year This may not be cool but just another thing.

Thanks
#nK

@private_matter

What is the type of year variable in your scenario? Can you explain how did you add the dropdown option in assign

@Nithinkrishna ,

I have downloaded your example but this does not populate a dropdown list in any form or shape as I wanted. The value only says ‘yearDictionary(2021)’

I need a list of options whereby when i click on the activity I get a dropdown list just like when you come to add properties, classes, namespaces, keywords etc… when hitting the spacebar key. That’s not what I was looking for.

1 Like

It’s a sting variable. not int32.

1 Like

@kumar.varun2
see the screenshot above I attached and you’ll understand how. basically, I add a variable of type string and i add the default expression something similar to what the variable’s name is or it could be the same, and then in the assign value i can declare the variable name.

1 Like

@private_matter

Can you share a sample workflow xaml file.

Tried to replicate your scenario but there is no dropdown list or the arrow

@kumar.varun2

Yes there is. see screenshot.

2021-07-28_184134

the dropdown won’t appear if you remove a previous value and attempt to directly type a variable. you must first clear it completely, then press enter (important), then when you click again and type a few first letters, the variables should automatically appear. see this video for more clarity: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online. cheers (:slight_smile:

1 Like

I understood your requirement @private_matter

For this you need to build Enum in a class library and then just install the package in UiPath.

Thanks
#nK

@Nithinkrishna

can you provide an example or steps on how to do this?

1 Like

@private_matter

It is IntelliPrompt that you are talking about. The shortcut for this is ctrl+space.

or right click and click on show intelliprompt

It shows the list of all variables, methods, classes etc…

so if you have variable already declared it will show in the list (intelliprompt)

yes i know how to do this. my main issue is how to get the same dropdown but by using a variable with type system.string array that has many strings all inside one single variable. take a look at my initial post above. this is much better because it reduces the amount of variables created in contrast to creating a new variable for every different value, and that is not to mention that it also reduces the amount of lagging drastically when opening the variables panel.

1 Like

There are two ways of doing it @private_matter

  • Creating a class library using Visual Studio and then use the package inside
  • Use data services entities to invoke and use, which is pretty easy to do if you have access to UiPath DataServices

Kindly confirm

#nK

The solution to your problem is given by @Nithinkrishna already.

1 Like

please show a detailed step-by-step on how to do this as I don’t know how to create a class library nor do I know how to use data services. It would be nice if you can send a video demonstrating your example.

1 Like

Yes, If you can please confirm if you have data services access. Then yes I can proceed with the steps or demo.

Else I will go with visual studio

For Data Services please check at your UiPath cloud

After navigating to data services

Thanks
#nK