I have read about other developers having issues getting the selection from list items but have not found a solution to my problem.
I have a RPA POC project to copy PDF form entry to a web portal. But to my surprise the robot can’t get the values from dropdown fields.
Some dropdowns are classified as combo boxes while others are classified as list items.
Get text, get full text, get OCR text activitties but all turned useless.
For combo box, get attribute ‘selectedItem’ worked, but same selectedItem attribute for list items did not work.
Note that i’m reading the form values, not filling it, so select item activity is not useful.
Strangely though, get OCR text worked for list items that are much longer in length, but contains foreign characters in the result.
For example, a country dropdown with “United States of America” be retrieved as “United States of America 1”. The foreign characters are random, does not follow a predictable pattern where I could use regEx and with many countries in the dropdown, you have no idea what the user selected.
On the other hand, states(abbreviated) dropdowns return trash even though they are also list items.
The only visible difference is the length. A two character US state dropdown is very short compared to country dropdown.
I also tried adding but the I get element cannot be found error so I had to take it out.
Get attribute with aastate returns empty string.
Can anyone help, please? This POC is big deal to demo to potential customer about RPA capabilities but things are not going in the right direction.
Try to use UiPath.PDF.Activities and use “Read PDFText”. I have used it before and it returns the texts of the PDF form even dropdowns, but disregarding the unselected items in the dropdown (i guess you are interested on the selected items only anyway). Then just use string manipulation to extract specific data you need from the PDFtext
Ok. Thanks. I will try that option. Not very solid on string manipulations, but I will try.
You can always come back to the forums if you need help with string manipulation and Regex, there are a lot of very helpful and capable people in that field.
If you want to learn yourself or ask a good forum question about regex, I suggest giving a look at this post. Its quite helpful for both learning and forming a question for the forums: