cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mdemarici123
Frequent Visitor

How can I extract a number in between two different characters in power automate?

 

Hi All, 

 

I am trying to use power automate to extract the numbers underlined below. I am lost on how to do so. As you can see the number will always be in between a dash and an underscore and the number could be either 3, 4, or 5 digits. Also sometimes there is another iteration of text in between the dash and underscore like in the project yellow document. I think I need to use Regular Expressions, but I am completely lost. 

 

Thank you in advance,

 

Marcus 

 

Mdemarici123_0-1640025370496.png

 

 

4 REPLIES 4
ScottShearer
Super User
Super User

@Mdemarici123 

You can use a split() action if all of the following are true:

  1. There is always a dash preceding the number
  2. There is always an underscore after the number
  3. There will never be more than one dash or there will always be the same number of dashes
  4. There will never be more than one underscore or there will always be the same number of dashes

In other words, there needs to be a pattern.

If all of the above are true, see my example below, let me know and I will provide an example.

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Mdemarici123
Frequent Visitor

Hi @ScottShearer  unfortunately there will not be a constant pattern, the only difference will be the situation in the above picture in "project yellow" I was curious to see if there is a way to tell flow to get a number and only a number that is in between the dash and the underscore. 

VictorIvanidze
Community Champion
Community Champion

Hi @Mdemarici123, than you have to use something like this:

https://powerusers.microsoft.com/t5/Building-Flows/How-to-know-if-an-variable-is-numeric/td-p/565181

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
ScottShearer
Super User
Super User

@Mdemarici123 

See my example below and give it a try.  Please let me know if this works for you.

image.pngimage.png

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,558)