Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 12

 

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

 

 

  • ScottShearer Profile Picture
    ScottShearer 25,150 on at
    Re: How can I extract a number in between two different characters in power automate?

    @Mdemarici123 

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

    image.pngimage.png

     

     

  • VictorIvanidze Profile Picture
    VictorIvanidze 11,863 on at
    Re: How can I extract a number in between two different characters in power automate?

    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

  • Mdemarici123 Profile Picture
    Mdemarici123 12 on at
    Re: How can I extract a number in between two different characters in power automate?

    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. 

  • ScottShearer Profile Picture
    ScottShearer 25,150 on at
    Re: How can I extract a number in between two different characters in power automate?

    @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.

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard