cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting an increasing number from a line of text

shaunreed1
Level 3
Hi, 

I am new to BP and struggling to fine a guide for expressions.  I understand how to use the expression builder but sometimes It isnt always fit for purpose so a guide detailing loads of expression strings would be great to aid my learning.  

My current issue is that I want to extract a number at the end of a line of text.  "Your order ref is 15", i used the expression RIGHT to get the last 2 digits however when the order number reaches order 100 then the expression will no longer be fit.  How can I extract an ever increasing number - Please reply in the simplest form to aid my understanding. 

Thanks in advance!

------------------------------
shaun reed
------------------------------
1 BEST ANSWER

Helpful Answers

You can also Replace( [your_text] ,"Your order ref is ","") => "15" if string is always the same and just number changes.

------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------

View answer in original post

6 REPLIES 6

shaunreed1
Level 3
I've been thinking and is it possible to maybe take the fill text and minus off the text leaving the number?

------------------------------
shaun reed
------------------------------

NrupalJoshi
Level 5
Hello @shaun reed, if your text has variable number length, you can use Utility String VBO​ "Extract Regex Values" action. This will give you the extracted value of however many numbers from your string in a collection. The Coll1 collection should have 2 fields Name and Value. In the Initial Value add one row, where Name will have OrdNo and keep value blank. Hope this helps.
18621.png


------------------------------
Rup Joshi
------------------------------
Rup Joshi

Hi,

This really helped.  I was wondering if you can help with another one.  I have extracted the order ref number now and it is sitting in a data item in the business object page.  I need to pass this to the process page.  How do I do this? The data item is called Order Ref.

Im assuming it would need to go into a collection so it will collect all of the orders.  This is part of training. ​

------------------------------
shaun reed
------------------------------

NrupalJoshi
Level 5
You can pass the data item via the End stage. So, open end properties and add your data item there. In your process when you are calling that object via action, open the properties, and accept that value in the Outputs.
Hope this helps

------------------------------
Rup Joshi
------------------------------
Rup Joshi

You can also Replace( [your_text] ,"Your order ref is ","") => "15" if string is always the same and just number changes.

------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------

Hey Shaun,

Its very easy please below steps.

1.Read the text from application.
2.Get calculation stage
3.Add replace function from left side function area
4.so your expression will be - Replace("Your order ref is 15","Your order ref is"," ") and store it in data item.
Details of replace function - Replace(Put your entire text here, Put here that text which need to replace,Put here replace text (above I have added " " that mean blank)


you will get only numbers every time

I hope you got your ans.

thanks

------------------------------
Nilesh Jadhav
Senior RPA Specialist
ADP
India
------------------------------
Nilesh Jadhav.
Consultant
ADP,India