Select items from an Excel cell having multiple values

Hello there,

I am trying to select few items from a checkbox in a website, the options to be selected are in an excel cell, the excel cell contains multiple values and are separated by comma for example: Florida, Nebraska, Alabama.
I want to select all the values which are present in the cell.

I tried to store it in an array of string but I don’t know how to select all the elements from it, I don’t even know whether all the elements are being stored or not.

Then I tried to use the select item method by passing the following command to take the input:

CurrentRow.ByField(“Job_State”).Split(“,”).ToString

It didn’t work.

Is there any way where I can select multiple values in a dropdown menu the input of which are stored in an excel cell?

@Shreesh_Bhardwaj

Use select multiple items activity to select items in a dropdown

Hi @Shreesh_Bhardwaj

Since you store the excel cell items in a array. Run a For Each loop to iterate through that Array and use Select item to do the process.

Or use Select Multiple Items Activity

For more information check the below docs:

Regards

@Shreesh_Bhardwaj

To select multiple items from a checkbox on a website using UiPath, where the options are stored in an Excel cell and separated by commas, follow these steps:

  1. Read the Excel Data: Use the Read Range activity to read the Excel file into a DataTable.
  2. Iterate Through Each Row: Use a For Each Row activity to iterate through each row of the DataTable.
  3. Split the Cell Value: Split the cell value containing the comma-separated states into an array of strings.
  4. Select Checkboxes on the Website: Use a loop to iterate through the array of states and select the corresponding checkboxes on the website.

I guess I will have to manually specify the options to be selected, but I want dynamic selection process and in multi selection method, I will have to manually specify the options to be selected, meanwhile I already have them stored in an excel cell.

Hi @Shreesh_Bhardwaj

Follow the below steps,
→ Use the assign activity to store the comma seperated values in a List variable. Let’s call the variable name as List_Values.

- Assign -> List_Values = CurrentRow.ByField("Column name").Split(",")

→ After assign activity drag and drop the For each Ui element activity and indicate the multiple values in a dropdown menu. Output of For each Ui element is CurrentElement.
→ Then use the Get Attribute activity and select the aaname attribute and save in a variable called PresentValue.
→ After Get attribute activity, insert the If condition to check the dropdown option contains List_Values, write the below condition,

List_Values.any(PresentValue)

→ In then block insert the click activity and pass the CurrentElement to the Input Element option in the Properties of Click activity.

It will iterate through each option in dropdown, which value met with the comma seperated value it will select. It will work for multiple options.

Hope it helps!!

I tried iterating the array as well, but that doesn’t seem to work, as the UiPath is throwing the error:
Select Item ‘Select’: Attribute not supported by the current UiNode.