Find element in "get full text"

Hello,

Is it possible to look for elements in the output text from the activity get full text?

I have used the get full text, and it is working. However i want to look for the number that appears after "batch number ". The number changes for every costumer, so it has to look at the space after “number”.

I hope someone can help me out!

HI @anon53238024

Yes… The get full text gives you a string right. So you can use Regex to find the the word “Batch number” and extract the value after that. Using the regex to get this output…

Use the Matches regex activity and you can generate the regex for it…

For example:

Hi
Once after storing the full text in a variable named strinput
Then use a assign activity like this to get the batch number

str_batchNumber = System.Text.RegularExpressions.Regex.Match(str_input.ToString,”(?<=batch number).(\d)+”).ToString.Trim

Cheers @anon53238024

I get an error saying that “regex” is a type in “regularExpressions” and cannot be used as an expression. Do you have a solution for this?

1 Like

I am not getting 46 as result.
This is the return i am getting from Regex.

System.Linq.Enumerable+d__97`1[System.Text.RegularExpressions.Match]

1 Like

HI @anon53238024

Yes… You have to use that variable inside a For Each activity to get the output… Just like this…

image

Aah sorry
I missed Match method while typing
That would work for sure giving us only the number
str_batchNumber = System.Text.RegularExpressions.Regex.Match(str_input.ToString,”(?<=batch number).(\d)+”).ToString.Trim

Cheers @anon53238024

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