How To Extract A Certain Text from SAP UI


Hi Guys,

Does anyone know how I can extract the 8003585755 from the whole line? Using get text, I keep getting the whole sentence and if I use a screenshot it will not get any info out of it.

If anyone could help it would be much appreciated.

Thank you

1 Like

Buddy @Brandon_Halim

Welcome to uipath community buddy…!

no worries buddy get text is very reliable and luckily you were able to select that as element and get the word as well
rather to fnd another way leaving this reliable one, why can’t we use this a string input and split them to get the exact value alone like this
out_value = Split(gettextvariable," ")(3).ToString

This would get you that value alone buddy
Kindly try this and let know buddy, this would work

1 Like

Try Match activity with regex pattern “\d{10}”.

Hi @Brandon_Halim,

You can use regex to fetch only the digits

Where in the input you need to enter text variable captured
And in the pattern- “\d+” which fetches only digit to the array.
In the array.index(0) the number will be captured

Thanks so much for your feedback!

I am still a newbie and I still don’t fully understand, would you mind elaborating in detail?

Currently this is my screen and I’m not sure where to add:
out_value = Split(gettextvariable," ")(3).ToString

Thank you!

1 Like


I don’t have the regex in my activity, do you know what package I have to download first?

Thank you!

Buddy once you get the text from get text activity and get the output from that activity with variable named gettextvariable of type string

  1. use a assign activity very next to it and in assign activity mention like this
    out_value = Split(gettextvariable," ")(3).ToString
    where out_value is of type string

thats all buddy you will get the text you want buddy @Brandon_Halim
with out_value and you can put that messagebox if you want

Hi ,

It should be available under UiPath Core Activities - (UiPath.Core.Activities.Matches)
I am using version 2018.4.3 and regex activity was by default present for me under Programming

It worked perfectly! Thank you so much!

1 Like

Thats Fantastic …

Kindly close this topic buddy with right comment marked as solution that could help others as well buddy
Cheers @Brandon_Halim

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