web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Getting substring out ...
Power Automate
Answered

Getting substring out of a string in PowerAutomate to find a digit/number

(0) ShareShare
ReportReport
Posted on by 68

Hi all,

 

Had a similar question before, but now there's a new requirement. I'm building this Flow that needs to rename a created document before it gets moved to a folder. Couldn't find what I'm looking for in here, so posting a new topic for it. I'm trying to get everything before the number of the document. For example, out of the string 'BugsBunny-Arn-999999-67378-CLMPDVVD-TB-GN.docx', I'm trying to make it to be only '999999-67378-CLMPDVVD-TB-GN.docx', need to make it look for a number/digit, remove everything before it and leave the name with what's left out of the string. What is the correct expression that will work? Have in mind that'd be a dynamic value, so I'm basically taking the Name of the file first and then need to convert it to have only what is after the first digit/number, with the first digit included of course. Thank you!

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    filename.png

    join(skip(split(outputs('fileName'),'-'),2),'-')
  • benny_blanco Profile Picture
    68 on at

    Hi @Paulie78 ,

     

    Is this going to look for a number within the string and remove everything before it, or is it going to remove everything after the second "-" character? As I need it to look for a digit/number and to remove everything before it. The digits might start and be after the second "-" character, they might be after the third, fourth etc., it needs to look for the first digit within a dynamic string/name value and remove everything before it. Thank you!

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Everything after the second - character.

  • benny_blanco Profile Picture
    68 on at

    This wouldn't work in this case, as the digits might start after the third, fourth character etc. Need it to find the first digit in the string and remove everything before it, any idea how to achieve that? Thank you!

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    Much more difficult and messy, but you can do it like this:

    https://ibb.co/w4cfJD7 

    filename2.png

    The expression in IsItLess is:

    if
    (
     equals(outputs('NumberPositionInFileName'), -1),
     variables('numberPos'),
     if
     (
     less(outputs('NumberPositionInFileName'), variables('numberPos')), 
     outputs('NumberPositionInFileName'), 
     variables('numberPos')
     )
    )
  • Paulie78 Profile Picture
    8,422 Moderator on at

    That screenshot isn't clear. Use this one:

    https://ibb.co/pfZbznB

  • benny_blanco Profile Picture
    68 on at

    Thank you! Will give it a try and let you know.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard