I Want to randomly select items in a select item. Can anyone help pls?

I Want to select items in select item. But ı want to do randomly. And also ı want to add a setting like “Dont pick the same item if you pick it before” Can anyone help me ?

Hi @ates.ceken ,

I would suggest first collect the select items in a list. Then take item randomly from the list and pass it to the select item selector. And mean time remove the passed item from the list as well.

1 Like

In the dropdown use type into activity and pass the item value.

Man can you explain a bit more ? How may ı going to pass the item value ? Like ı am new to rpa world and ther is realy no info about “Random selection on a item list” Kinda thing. I Creat a type into but ı dont understand how this is help me to get a random selection.

Hi @ates.ceken,

@manjula_rajendran’s suggestion would work, perhaps I can explain it a bit better.

If you can get all of the values the dropdowns give you into a list or String array, you can then get a random integer variable and refer to the list item with the variable in the Select Item you had in a screenshot you deleted.

To get the list of items, get a Get Attribute activity and in the attribute, specify “items”. The output variable would be a String array.

You can convert the String array to a list in a following assign with the following inside:
StringList = StringArray.ToList

You can then get a random integer by using one of the solutions in the below post:

To get your random item from the dropdown list, use a select item and specify your list and integer like so: StringList(IntVar). This should then give you a random item in your list that you can specify in the Select Item activity.

To then remove the entry from the list, look at the following topic and follow the suggestions:

Hope this helps!

Hi @ates.ceken ,

  1. Use get attribute selector and collect the items. Save the values in list. If there are no comma then join with (",").
  2. Now choose random value from the list and assign it to variable.
  3. Go to the browser, in the select item dropdown filed pass the value of variable from the second step.
  4. Do the steps what you wanted to do.
  5. Remove the 2 step value from the 1step list

Hi @ates.ceken,

Have you managed to resolve your issue?