Want to extract TaxID

I’m new to UIPath It’s really appreciated if someone help me
TaxID: RO892123
Name: Star Software
Address: Aleea Rozelor 84
City: Iasi, Romania
I want to extract only TaxID can anyone please help me

Hi @rehan.shaikh1 :wave:

Extract everything, split based on space, insert them into an temporary array, and get array(0). This will return the first item.

Hope this helps! Let me know if you are facing any issues!

1 Like
  1. Use “Get Text” activity and extract the whole thing and save it in a variable, lets say “var_name”.
  2. After that use the following expression in order to extract only “RO892123”
    output_var=var_name.Substring(var_name.IndexOf("TaxID: ")+"TaxID: ".Length).Split(Environment.NewLine.ToCharArray)(0)
1 Like

Hi @rehan.shaikh1

Welcome to UiPath Community!

As @monsieurrahul and @Varun_Jain mentioned are the ways to achieve this and if you want to use REGEX to extract Taxid then refer this
image
Regards,
Aditya

2 Likes

There’s a little correction in your RegEx expression, kindly put “\s” after “TaxID:”.

2 Likes

Hi @Varun_Jain

The use of not placing \s is if we don’t know whether that space is always present or not or we can also use like this \s?.
We can trim the output variable to get it without spaces.

Regards,
Aditya

3 Likes

Thank you @monsieurrahul I’m able to fix that

2 Likes

Really appreciated you quick response @desineediaditya

1 Like

Hi @rehan.shaikh1

Which method suits better for your query mark that as a solution. It will help the ones who are looking for the same query.

Regards,
Aditya