Select checkbox for value matching Excel value in Uipath

hello.

The information in the Excel file is being registered on the web.

After reading the Excel file data using read range
Data was converted using a filter data table.

You must check the category checkbox that matches the category of the Excel file.
For example, an Excel file contains columns containing the values of apple, orange, strawberry, and melon.

On the web, you must check the box for apple, orange, strawberry, or melon in item A.
You must check the Excel values in the same way for items B and C below.

Excel file example
name category
A apples
B oranges
C strawberries
D melons

Since I am a beginner,
please provide the name of the activity used and a detailed explanation.

Thank you for your help.

**
I did as you said and it worked. Thank you all.

Currentrow(“Category”).tostring.split(“,”).toarray
By converting the part to dt_test.rows(0).item(“Category”).ToString.Split(“,”).toarray
After receiving it as an array, I used the value by putting it in the for each activity.

I added a click activity inside the for each activity and modified the strict selector part to “+currentItem+”.

Hi @myangh860

After read range Use for each row and add filter dataTable

In the “Filter Options” section, set the filter condition based on the current row’s category. For example, if the category is ‘apples’, you can use [category] = 'apples'

Hope this helps

read the excel then use filter data table filter those values.
for each row of that filter data table loop through one by one value in the filtered data table get that value and make the selector dynamic.

Hi @myangh860

DT1.AsEnumerable.Any(Function(r) r(“category”).ToString.ToUpper.Equals(“APPLE”))

Use the above syntax it will give you the boolean output

use if condition in then you can use click acctivity to click the check box

Cheers!

Thank you for your reply.
번역기를 사용하였습니다.

@Dinesh_Guptil , @sanjay3 , @Gayathri_Mk

I have three additional questions.

  1. @Dinesh_Guptil , Where should I use the phrase you provided?

  2. The field that matches the current ‘number of names’ is created using an if statement.
    Just check the box for the ‘Fruit’ category that matches each ‘name’.

Use the ‘Click’ activity to target ‘Apple’
I modified the ‘apple’ part in ‘strict selector’ to “+variable name+”. Why doesn’t it work?

When variable name = sCatetype
“”

  1. The Excel file is modified and sometimes more than two fruits are selected in A. There are 12 actual checkbox categories.

When variableizing, I used dt.rows(name1).item(“category”).ToString.
I would like to know how to handle variables when I need to select multiple fruits as shown below.

Excel file table example)

Name Category
A apple, orange
B Blueberry, Strawberry
C Strawberry

There are checkbox pages for each name on the web.

web example)

A ㅁApple ㅁOrange ㅁBlueberry ㅁStrawberry ㅁMelon

thank you for your reply

@myangh860
take a boolean variable and use my syntax it will give you true or false value
use the boolean variable in if condition

Cheers

@myangh860

Use for each row in datatable

Inside use for each

Pass the below expression in for each

Currentrow(“Category”).tostring.split(“,”).toarray

Inside for each use click activity

And make the selector dynamic by passing the currentItem of for each

Hope this helps

1 Like

Hi

→ Use the Read Range activity to read the Excel file data into a DataTable.
→ Use the Filter Datatable activity to filter the DataTable based on the category column. For example, to filter the DataTable for the category “apple”, you would use the following filter expression:
[category] = “apple”
This will filter the DataTable to only include rows where the category column is equal to “apple”.

→ Iterate through filtered DataTable: Use the For Each Row activity to iterate through the rows of the filtered DataTable. get the category value using the Item() method.
→ Click on the category checkbox: Use the Click activity to click on the category checkbox that matches the category value from the Excel file. To do this, you will need to use the UiExplorer to identify the selector for the category checkbox.

Thank you

HI @myangh860

Follow this steps:

// Read Excel File
Read Range activity → Output DataTable: ExcelDataTable → File Path: “YourFilePath.xlsx”

// Filter DataTable
Filter DataTable activity → Input DataTable: ExcelDataTable → Output DataTable: FilteredDataTable
→ Condition: “[category] = ‘apples’” (Repeat for other categories)

// Loop Through Rows
For Each Row activity → Input: FilteredDataTable
→ Body:
- Use a Click activity to check the checkbox corresponding to the category.
- Selector should be dynamic, incorporating the category value.

// Your Web Automation Continues…

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