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

Notifications

Announcements

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?
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,204 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard