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 / How to split a text us...
Power Automate
Suggested Answer

How to split a text using 'delmiter _'

(1) ShareShare
ReportReport
Posted on by 28
Hi,
I have an expression from which I need to extract a specific value using the delimiter '_'.
The extracted text is:-
"Split_1.pdf"
And the text we need to extract from it is only '1'.
How would anyone be able to do it?
Split.png
I have the same question (0)
  • Suggested answer
    Dominik Stalzer | primeone Profile Picture
    71 on at
    Use split() Function:
    First, split the text by the _ delimiter, which will give you an array with two elements: "Split" and "1.pdf".
    Use another split() to remove .pdf
    Then split the second part "1.pdf" using the . delimiter to extract the value 1.
     
    split(split('Split_1.pdf', '_')[1], '.')[0]
     
  • Suggested answer
    eetuRobo Profile Picture
    4,535 Super User 2026 Season 1 on at
    Better way might be to use Parse text -action to just get the number without needing to split it into a list. So you get the number with just one action when using regex that finds the number between underscore and .pdf

    Text to find (regex): (?<=_)\d+(?=\.pdf)
    Is regular expression 
    Toggled on


    Then Match variable has the number inside it:


    ​​​​​​​
    If you want to do this with split action:
    Change "Delimeter type" to be "Custom" and then add to "Custom delimeter field "_" like so:
     
    Then you get [Split, 1.pdf]
     
    Then you could use replace on the second item on the list which s %TextList[1]% and text to find .pdf and replace with %''% (empty string)
     
    Result is 1

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 582

#3
Haque Profile Picture

Haque 529

Last 30 days Overall leaderboard