String Manipulation, Extract Number From a Text then Perform

I have an automation where I search data based on a search criteria that is sent back. I have posted some examples below. Im trying to perform actions based on the number of searches that are returned. In the example the section of the string that shows the number of matches received. (“4 Matches, 43 Matches, 1 Match”)
I have been using a get text activity to pull the texts in the examples below. Im trying to make decisions based on the number of matches in the text. If Matches is less then 1, If matches is greater than 20, If matches is less then 20. Any suggestion for the best way to run conditions based on the number of matches that is returned, OCR, GET TEXT, STRING TRIM?

Example of text:
Your Search on Name: MARK FOSTER AYALA DOB: XX/XX/1983 resulted in 4 Matches
Your Search on Name: SETH BONNER DOB: XX/XX/1983 resulted in 43 Matches
Your Search on SSN: XXX-XX-111 resulted in 4 Matches
Your Search on Name: NATRON MEANS Address: 12 SOUTH 45TH STREET, MISSOULA, NY resulted in 1 Matches
Your Search on Name: NATRON MEANS Address: 12 SOUTH 45TH STREET, MISSOULA, NY resulted in 0 Matches

Hi @NATHAN_MORA

You can use regex to get the number of matches

The regex expression used is

\d+(?= Matches)
2 Likes

Kumar,
Thanks for the response. Would i use a get text activity to get the text first and then use the Regular Expression?

@NATHAN_MORA

Ideally you should get the raw text first by using any of the activity that is related to scraping text from UI elements (Get Text is one of them) and save it in a string variable. Then you can apply regex over the string variable.

I used a get text activity and puled the text just not sure how to use the regular expression and extract the text. Could you post a workflow ? or a process

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.