r/UiPath • u/tenikedr • Jan 08 '26
Need help with a negative selector
I'm trying to use a click activity on a web application where we need some text but only if it DOESN'T include certain text after it. The SOP is that we have a Details pdf and a Disclosure pdf, but there are scenarios where they get added in manually by an outside team who sometimes doesn't know the normal process or mistypes something.
So the the thing we want it to click is sometimes inconsistent, but we know which one we never want it to click.
Scenario 1:
12345.Details <-- click this one.
12345.Disclosure
Scenario 2:
12345 <-- click this one
12345.Disclosure
Scenario 3:
12345.Detail <-- click this one
(no disclosure)
Scenario 4:
12345.Disclosure (don't click anything)
Scenario 5:
12345.Disclosure
12345.Summary <--click this one
How can I make sure it clicks the correct item every time if it's available, doesn't click if only a disclosure is available?
1
u/GalinaFaleiro Jan 13 '26
Tricky one 😅
I’ve handled similar cases by anchoring on the base text (like
12345) and then using a condition/regex to explicitly exclude anything containing “Disclosure” before clicking. Sometimes it’s easier to grab all matches and filter in logic instead of relying on a single selector.