Validate which checkbox is checked from multiple checkboxes in Pdf using Uipath

Hi everyone
I have a requirement where I have to validate which checkbox is checked from multiple checkboxes in Pdf document. The pdf is having around 50 checkboxes which are not in order.
I have used getattribute activity but it can only retrieve one checkbox at a time.
Does anyone is having any solution for it.

@Manjit Can you Send the file, and can you show us the selector of Get Attribute Activity?

Is there a pattern to how these items are laid out? I’m not sure how selectors act within PDFs, but lets assume you had a 5x10 grid of checkboxes…

If you know the first checkbox was at: div[1]/div[4]/div[1]/input[1]
and the last was at: div[1]/div[4]/div[10]/input[5]
where the third div element was the line of checkboxes, and the input element was the checkbox on the row…

you could create a variable like the following:
selectorVar = "div[1]/div[4]/div[" + divCount.ToString + "]/input[" + checkboxCount.ToString + "]"

Using this you could do something like this:

divCount = 1;
while(divCount <= 5){
    checkboxCount = 1;
    while(checkboxCount <= 10){
        selectorVar = "div[1]/div[4]/div[" + divCount.ToString + "]/input[" + checkboxCount.ToString + "]";
        GetAttributeActivity(selectorVar);
        checkboxCount += 1;
    }
    divCount += 1;
}

This would go through each checkbox, and you can use your get attribute activity on them. If each row can only have 1 checkbox checked, you could have an array[5] where you store the values, if each checkbox can be checked then you can use a 5x10 array of ints where 1 = checked and 0 = unchecked.

This wouldn’t be the prettiest solution, but it would definitely get the job done assuming the data is structured with a pattern. If it’s unstructured then I’m not certain how you would get this done without a very messy solution that would be a pain to go back and edit in the future.

Here is the selector of the get attribute
getattribute
image

the “text” attribute is checked or unchecked according to the checkox

@Manjit Why have you put “text” in Get Attrbute? Shouldn’t it be “checked”? :sweat_smile

@Manjit Check this workflow Process1.zip (32.0 KB) Open the Pdf and keep it open. Then check the selectors in workflow. If Validation is proper then just run the Workflow. Hope what i’m trying to explain works for you :sweat_smile: