Dynamically Click Checkbox in Software if Found Data

Hi, please guide me if can!

I would like to be able to mark/click checkboxes as checked. This is the file if you need to see the flow:
BankRecon (1).xaml (74.1 KB)

Do I use Find Children? I know there is a Check Activity for radio button/checkboxes but I am uncertain on how I would be able to use it on dynamic purposes?

These are the checkboxes I will be checking. In the workflow, I am comparing between two datatables. If found, these checkboxes will be ticked. There are hidden rows that I need to scroll the window first before I can see more.

When seen in UI Explorer, the cells that have the checkbox have “role = check box”, would this help?

1 Like

Actually the index position will help you here along with DATA EXTARCTION

  1. First extract the table as a datatable using data extraction

  2. Then use a FOR EACH ROW activity and pass dt as input

  3. Inside the loop compare the date value and based on your condition if it is yes use a CLICK or CHECK activity to click it’s corresponding check boxes

To click exact corresponding check boxes find the selector of first check box and see whether it has any attribute named idx or Id

That is the index position of the check box in each row

Or

Sometimes it might be with tablerow attribute

Increment that attribute value inside that for each row activity

Pass tht incremented value to selector through a variable created in selector

Cheers @beepboop

Index position? Do you mean What is the identifier for the rows?
And there is no ID, for some weird reason. God, I really hate this accounting software. As you can see from the picture, row 1 and row 2 have no ID for each row.

I’m really new to this whole thing, what does Icrementing value and passing it means?

since theres the assumption that robot cant capture the tables without scrolling down (from your previous posts) we need to create another dictionary (during data extraction stage)

key = unique value e.g. description+credit
value = row number + page number
(page number = number of times you have to scroll down)

so this dictionary will look like this (example)
page1:
key: description1Credit1 value: 0,1
key: description1Credit1 value: 1,1

page2:
key: description1Credit1 value: 0,2
key: description1Credit1 value: 1,2

then when you are comparing tables and have to click a checkbox, you can simply lookup this dictionary using description+credit and it will return the row# to click and page# to scroll to.

@beepboop can you paste the selector for checkbox for 1st and 2nd rows?

Sorry was trying to understand what you’re telling me haha and sorting bugs on my sequences. Here it is

Fine
Though it is not coming in selector it might reflect in property explorer
So try using find children activity if data extraction doesn’t help us here

Here you go on how use a find children activity for a data grid

Cheers @beepboop

Hi @Palaniyappan ,
I did notice each row has a name, would that be of any help? Example, I indicated element on UI Explorer and clicked in the cell that has the checkbox.

image
image

My coworker was able to help using the index number, but it requires a lot of if else to cover how much row indexes there might be. So far he’s only shown me up until the 20th index.

can u capture the next row and check if the name is still 2

Nope the name changes!

there’s also idx=‘7’ but I think that’s the column’s name rather than row name.
Here is the latest BankRecon if you wanna see. The NEWCLICK.xaml is someone else showing a method using the “name” attribute(?).
BankRecon (1).xaml (74.7 KB)
NEWCLICK.xaml (12.1 KB)

It’s suppose to check it only if it matches by the way. So I have to identify the row and data somehow?
I’m still uncertain how to go about it since my boss said the transactions can reach hundreds T-T so do I just loop it over and over? I have to take account that when I scroll the data replaces the same row name.

So, it displays 10 rows. Even when I scroll down and new data replaces it, the name still sets as; for example; 1 because it’s in the first row, 2 because it’s in the second row. Even though now it is a different data all together. For example, now it’s the 11th row (from datatable) in the 1st row, and it’s the 12th row in the 2nd row.

yes i know which is what my reply above will solve.
anyway i implemented it here
BankRecon (1).xaml (93.1 KB)

theres one part you need to fill in here (scroll all the way up in table)
image

now when the bot is extracted datatable it will fill in a dictionary uniqueKeyToPageRowNumberDictionary
key = Column3+COlumn4, value = pageNumber+","+rowNumber

after lookup success, its now able to use dictionary to find the pageNumber +rowNumber

then it will scroll to pageNumber(using down arrow key) and then use the returned rowNumber to click (by updating the selector to name=rowNumber.toString)

This is the error that pops up after I wait for the process to end itself.

This is a short video of the process
https://flashbackconnect.com/Movie.aspx?id=hc_9xtfAsYLLBk3mWj7xCg2

try this
BankRecon (1) (1).xaml (93.6 KB)


I got the same error too

can you show the whole log

especially this part
"Adding to dictionary: key = … page…

for both pages

04/19/2022 14:12:13 => [Debug] Debug started for file: BankRecon (1) (1)
04/19/2022 14:12:15 => [Info] BankRecon execution started
04/19/2022 14:12:30 => [Debug] Extracting Datatable...
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key Text10 to page 1, and row 1
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key HONG LEONG BANK0 to page 1, and row 2
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key CIMB BANK CREDIT CARD40.79 to page 1, and row 3
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key TRAVELOKA SDN BHD514.16 to page 1, and row 4
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key DINASTI CITRA MANAGEMENT0 to page 1, and row 5
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key LODGING PARTNER0 to page 1, and row 6
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key CIMB BANK CREDIT CARD222.77 to page 1, and row 7
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key TRIP.COM TRAVEL SINGAPORE36.54 to page 1, and row 8
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key TRIP.COM TRAVEL SINGAPORE2701.78 to page 1, and row 9
04/19/2022 14:12:30 => [Debug] Adding to dictionary: key TNG DIGITAL SDN BHD- COLL74 to page 1, and row 10
04/19/2022 14:12:32 => [Info] Scrolling down...
04/19/2022 14:12:33 => [Debug] Extracting Datatable...
04/19/2022 14:12:33 => [Debug] Adding to dictionary: key CIMB BANK CREDIT CARD1805.11 to page 2, and row 12
04/19/2022 14:12:33 => [Debug] Adding to dictionary: key TRAVELOKA SDN BHD282.08 to page 2, and row 13
04/19/2022 14:12:33 => [Debug] Adding to dictionary: key Text1Text1 to page 2, and row 14
04/19/2022 14:12:35 => [Info] Scrolling down...
04/19/2022 14:12:37 => [Debug] Extracting Datatable...
04/19/2022 14:12:38 => [Info] Cant scroll down anymore... end!!!
04/19/2022 14:12:41 => [Info] Check if  exists in csv table...
04/19/2022 14:12:41 => [Info] Not found in csv dt
04/19/2022 14:12:41 => [Info] Check if CIMB BANK CREDIT CARD40.79 exists in csv table...
04/19/2022 14:12:41 => [Info] Row found in index 2 ! going to page 1, row 3
04/19/2022 14:12:42 => [Info] Check if TRAVELOKA SDN BHD514.16 exists in csv table...
04/19/2022 14:12:42 => [Info] Row found in index 3 ! going to page 1, row 4
04/19/2022 14:12:43 => [Info] Check if DINASTI CITRA MANAGEMENT  exists in csv table...
04/19/2022 14:12:43 => [Info] Not found in csv dt
04/19/2022 14:12:43 => [Info] Check if LODGING PARTNER exists in csv table...
04/19/2022 14:12:43 => [Info] Not found in csv dt
04/19/2022 14:12:43 => [Info] Check if CIMB BANK CREDIT CARD88.02 exists in csv table...
04/19/2022 14:12:43 => [Info] Not found in csv dt
04/19/2022 14:12:43 => [Info] Check if CIMB BANK CREDIT CARD222.77 exists in csv table...
04/19/2022 14:12:43 => [Info] Row found in index 6 ! going to page 1, row 7
04/19/2022 14:12:43 => [Info] Check if TRIP.COM TRAVEL SINGAPORE36.54 exists in csv table...
04/19/2022 14:12:43 => [Info] Row found in index 7 ! going to page 1, row 8
04/19/2022 14:12:44 => [Info] Check if TRIP.COM TRAVEL SINGAPORE2701.78 exists in csv table...
04/19/2022 14:12:44 => [Info] Row found in index 8 ! going to page 1, row 9
04/19/2022 14:12:45 => [Info] Check if TRAVELOKA SDN BHD282.08 exists in csv table...
04/19/2022 14:12:45 => [Info] Row found in index 11 ! going to page 2, row 13
04/19/2022 14:12:47 => [Info] Scrolling down...
04/19/2022 14:13:17 => [Error] Click 'cell': Could not find the UI element corresponding to this selector:
[1] <wnd app='daccount.exe' cls='daccount9c*' title='BANKRECON - ACCOUNTING SYSTEM v.9.9.5.6'/>
[2] <wnd cls='daccount9c*' title='Bank Reconciliation Statement'/>
[3] <ctrl name='Gride1' role='table'/>
[4] <ctrl name='View 1' role='table'/>
[5] <ctrl name='13' role='row'/>
[6] <ctrl idx='7' role='cell'/>

Search failed at selector tag:
[5] <ctrl name='13' role='row'/>

The closest matches found are:
[83%] <ctrl name='1' role='row'/>
[83%] <ctrl name='3' role='row'/>
[75%] <ctrl name='10' role='row'/>
[50%] <ctrl name='2' role='row'/>
[50%] <ctrl name='4' role='row'/>
[50%] <ctrl name='5' role='row'/>
[50%] <ctrl name='6' role='row'/>
[50%] <ctrl name='7' role='row'/>
[50%] <ctrl name='8' role='row'/>
[50%] <ctrl name='9' role='row'/>

make sure youre using the latest version, can you try again with this? if it doesnt work paste the log again
BankRecon (2).xaml (99.0 KB)

latest version of BankRecon right? yes I am

04/19/2022 14:28:36 => [Debug] Debug started for file: BankRecon (12)
04/19/2022 14:28:39 => [Info] BankRecon execution started
04/19/2022 14:29:33 => [Debug] Extracting Datatable...
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key Text10 to page 1, and row 1
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key HONG LEONG BANK0 to page 1, and row 2
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key CIMB BANK CREDIT CARD40.79 to page 1, and row 3
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key TRAVELOKA SDN BHD514.16 to page 1, and row 4
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key DINASTI CITRA MANAGEMENT0 to page 1, and row 5
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key LODGING PARTNER0 to page 1, and row 6
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key CIMB BANK CREDIT CARD222.77 to page 1, and row 7
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key TRIP.COM TRAVEL SINGAPORE36.54 to page 1, and row 8
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key TRIP.COM TRAVEL SINGAPORE2701.78 to page 1, and row 9
04/19/2022 14:29:34 => [Debug] Adding to dictionary: key TNG DIGITAL SDN BHD- COLL74 to page 1, and row 10
04/19/2022 14:29:36 => [Info] Scrolling down...
04/19/2022 14:29:37 => [Debug] Extracting Datatable...
04/19/2022 14:29:37 => [Debug] Check index 1
04/19/2022 14:29:37 => [Debug] Check index 2
04/19/2022 14:29:37 => [Debug] Check index 3
04/19/2022 14:29:37 => [Debug] Check index 4
04/19/2022 14:29:37 => [Debug] Check index 5
04/19/2022 14:29:37 => [Debug] Check index 6
04/19/2022 14:29:37 => [Debug] Check index 7
04/19/2022 14:29:37 => [Debug] Check index 8
04/19/2022 14:29:37 => [Debug] Check index 9
04/19/2022 14:29:37 => [Debug] Check index 10
04/19/2022 14:29:37 => [Debug] Check index 11
04/19/2022 14:29:37 => [Debug] Check index 12
04/19/2022 14:29:37 => [Debug] Adding to dictionary: key CIMB BANK CREDIT CARD1805.11 to page 2, and row 12
04/19/2022 14:29:37 => [Debug] Check index 13
04/19/2022 14:29:37 => [Debug] Adding to dictionary: key TRAVELOKA SDN BHD282.08 to page 2, and row 13
04/19/2022 14:29:37 => [Debug] Check index 14
04/19/2022 14:29:37 => [Debug] Adding to dictionary: key Text1Text1 to page 2, and row 14
04/19/2022 14:29:37 => [Debug] Check index 15
04/19/2022 14:29:37 => [Debug] Check index 16
04/19/2022 14:29:37 => [Debug] Check index 17
04/19/2022 14:29:37 => [Debug] Check index 18
04/19/2022 14:29:37 => [Debug] Check index 19
04/19/2022 14:29:37 => [Debug] Check index 20
04/19/2022 14:29:39 => [Info] Scrolling down...
04/19/2022 14:29:40 => [Debug] Extracting Datatable...
04/19/2022 14:29:41 => [Info] Cant scroll down anymore... end!!!
04/19/2022 14:29:44 => [Info] Check if  exists in csv table...
04/19/2022 14:29:44 => [Info] Not found in csv dt
04/19/2022 14:29:44 => [Info] Check if CIMB BANK CREDIT CARD40.79 exists in csv table...
04/19/2022 14:29:44 => [Info] Row found in index 2 ! going to page 1, row 3
04/19/2022 14:29:47 => [Info] Check if TRAVELOKA SDN BHD514.16 exists in csv table...
04/19/2022 14:29:47 => [Info] Row found in index 3 ! going to page 1, row 4
04/19/2022 14:29:50 => [Info] Check if DINASTI CITRA MANAGEMENT  exists in csv table...
04/19/2022 14:29:50 => [Info] Not found in csv dt
04/19/2022 14:29:50 => [Info] Check if LODGING PARTNER exists in csv table...
04/19/2022 14:29:50 => [Info] Not found in csv dt
04/19/2022 14:29:50 => [Info] Check if CIMB BANK CREDIT CARD88.02 exists in csv table...
04/19/2022 14:29:50 => [Info] Not found in csv dt
04/19/2022 14:29:50 => [Info] Check if CIMB BANK CREDIT CARD222.77 exists in csv table...
04/19/2022 14:29:50 => [Info] Row found in index 6 ! going to page 1, row 7
04/19/2022 14:29:52 => [Info] Check if TRIP.COM TRAVEL SINGAPORE36.54 exists in csv table...
04/19/2022 14:29:52 => [Info] Row found in index 7 ! going to page 1, row 8
04/19/2022 14:29:55 => [Info] Check if TRIP.COM TRAVEL SINGAPORE2701.78 exists in csv table...
04/19/2022 14:29:55 => [Info] Row found in index 8 ! going to page 1, row 9
04/19/2022 14:29:58 => [Info] Check if TRAVELOKA SDN BHD282.08 exists in csv table...
04/19/2022 14:29:58 => [Info] Row found in index 11 ! going to page 2, row 13
04/19/2022 14:30:02 => [Info] Scrolling down...
04/19/2022 14:30:32 => [Error] Click 'cell': Could not find the UI element corresponding to this selector:
[1] <wnd app='daccount.exe' cls='daccount9c*' title='BANKRECON - ACCOUNTING SYSTEM v.9.9.5.6'/>
[2] <wnd cls='daccount9c*' title='Bank Reconciliation Statement'/>
[3] <ctrl name='Gride1' role='table'/>
[4] <ctrl name='View 1' role='table'/>
[5] <ctrl name='13' role='row'/>
[6] <ctrl idx='7' role='cell'/>

Search failed at selector tag:
[5] <ctrl name='13' role='row'/>

The closest matches found are:
[83%] <ctrl name='1' role='row'/>
[83%] <ctrl name='3' role='row'/>
[75%] <ctrl name='10' role='row'/>
[50%] <ctrl name='2' role='row'/>
[50%] <ctrl name='4' role='row'/>
[50%] <ctrl name='5' role='row'/>
[50%] <ctrl name='6' role='row'/>
[50%] <ctrl name='7' role='row'/>
[50%] <ctrl name='8' role='row'/>
[50%] <ctrl name='9' role='row'/>

I’ve not made any changes while we’re discussing this because I worry it’ll cause a whole another problem

sorry, try this. its because The table is acting weird. After 2nd page, extract datatable will also extract data from previous pages

pls try this
BankRecon (2).xaml (99.6 KB)