As per the image below, I’ve successfully set up dynamic selectors before but on this one, it’s not automatically clicking as what is scraped by the Data Table, is not what applies to the ‘aaname’
Hi @steve1977beyond ,
Use Dynamic selector using * Key.
try below dynamic selector. aaname - strSubMenuLinks.Split(";"c)(0) followed by * Selector <webctrl parentid='giSelectionMatCardTitle_*|*' tag='SPAN' aaname='"+strSubMenuLinks.Split(";"c)(0)+"*' />
What I have done now is removed all spaces in the information that’s to be looked up in the data table - the only issue is that the values in the data table, still have spaces.
How would I remove spaces from each line in the data table?
you can trim whitespace from the start and end of strings using string.trim, or you can remove all instances of a space anywhere in the test by using string.replace(" “,”")
Also, if you are using modern activities then you can use ‘fuzzy selectors’ which have a bit more give in them, I havent had a ton of experience with them but that may answer your initial question around still clicking on a 99% match.
Thank you for the reply I did use Fuzzy Selectors in the end, and got it clicking the first 4 boxes but then it failed.
So ultimately I’m going to try and fix the root cause and that’s the item captured in the data table, has less spaces when it’s clicked. All a bit bizarre why it’s not working tbh with you.
With regards to trimming the whitespace, I’m able to do that on a variable - how would i do it for a data table?
you can iterate through the datatable using a for each, then have an assign which performs the change. for example if the data you wanted to trim was in the first column if the datatable then you would:
Use For Each Row on the Datatable in question
then in the body of the for each have:
Assign:
To = Row(0)
Value = Row(0).tostring.trim (or a variant of this like the replace function I put earlier)
Then you are effectively going through each row of your table cleaning up the spaces from the text
As per the attachment, what I’m looking for, ties up 100% with what’s in the variable but it’s still not working.
If I use a fuzzy selector then it finds the first 4 but on the 5th it just says it cannot find the click activity.
So the closest match is what UiPath has read on the page and pulled as essentially potential matches. so this will be representative of whats on the page not whats in the variable.
Looking over this again, there is a different way you could also go about this, which would be to use wild cards in the selector. You will need to put some thought into what you want to keep and exclude from the piece of text but as an example - if the number at the beginning of the piece of text (in your example the 11.01 part) is unique then you could use that with a wildcard * after it.
This is easiest to achieve when the space is still left in the data, in which case you could put this in your selector to replace the {{strSubMenuLinks2b}} part: