cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wsobhi
Level: Powered On

Microsoft Flow ( Remove String from Numbers )

Hello,

 

I want to design a flow which when a new email arrives in my inbox, I want to parse the string from the email subject and keep only the numbers to be inserted using sql server.
For example :

(rjyrug76745jhjghfr) want only the numbers (76745)

or (uifiry77rjghrff87876) want only the numbers (7787876).

 

Regards,

2 REPLIES 2
Super User
Super User

Re: Microsoft Flow ( Remove String from Numbers )

Hi @wsobhi,

 

The best way is define a function in SQL and extract the number from the string

Microsoft doc
https://docs.microsoft.com/en-us/sql/relational-databases/user-defined-functions/create-user-defined...

Example
https://blog.sqlauthority.com/2018/08/30/sql-server-udf-user-defined-function-to-extract-only-number...

If you want to do via flow then you need to define an Azure function and put the extract logic.

Then call the Azure function from flow

https://docs.microsoft.com/en-us/azure/azure-functions/functions-flow-scenario

 

If you find it useful then please mark it as accepted solution.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Highlighted

Re: Microsoft Flow ( Remove String from Numbers )

Hi @wsobhi,

That is definately possible but a bit tricky.

 

Big picture of your algorythm is following:

1. iterate throughout each character in a string

2. if character is a number add it to an output collection

 

For part 1:

- create counter variable = 0

create outputString variable = ""

- use Do Until action counter = length of your string (use length function for that)

- take next character using following function: 
substring(<YOUR STRING HERE>,variables('counter'),1)

 

For part 2: 

- use if action with following: int(<above function) = true

- use action Append to string variable

 
Once your algorythm exit Do Until loop the outputString variable will contains your numbers
 
------------------------
If my reply helps you please mark it as Solution so others can find it easier

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,943)