Split string from outlook

Hii All,
I have a string “Invoice released for payment: Invoice #: 2555277” and I want to get only 2555277 so what type of regular expression I will Use??

Hello @arpita2
Here is simple example of Regex which you can use. This website is also very helpful with creating Regex.

Edit: Sorry my link was not saved :slight_smile:

@arpita2
Save that string to a variable named in_string
in an assign activity like
InvoiceNumber = split(in_string," #: ")(1).ToString

Hope this would help you buddy…

Cheers…

Hello @arpita2
Instead of regex expression why don’t you do it in substring functions?
Like expression is
say that
your_string = Invoice #: 2555277
some_Variable= your_string.substring(your_string.lastindexof(" ") + 1)
check and Let me know!

regards,
Sriram

thanks @Palaniyappan @Sriram07 for your help.

Hi,
I have a query ,I want to read outlook subject and write it into excel so I have done it successfully.
but I want that new outlook value should append in excel file and previous data should be exist.
so what should I do.
I use append activity instead of write range but Its not working.
Please help.

@arpita2

It should work. Could you please tell the steps you followed ?

hi @lakshman
Main_outlook_file.xaml (9.8 KB)

Its working fine but I want to use append activity to append the new data in excel .but when I use append instead of write it gives me error.

Please check

@arpita2

Yes, I checked your workflow and its working fine. And also you used Write Cell activity not Write Range activity.

If we have input of type DataTable then we will use Write Range or Append Range activity to write into excel file. But here your input is of type string. In this case, Write cell activity is better to write into excel file. What ever you did is correct.

May I know why you want to use Append Range activity here ?

@lakshman
I want that new outlook value will be save in excel file but old data should exist.
new outlook value will be save after the old data ,not override the old data.

@arpita2

You took index value as ‘2’ right. Instead of that pass DataTable row count.

  1. use Read Range activity and read excel data and store output in dataTable.
  2. Index = DataTableName.Rows.count
  3. Continue your process as it is.