Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 7xmGJOZgM+/q19kAfHjm/i
Power Automate - Power Automate Desktop
Suggested answer

How to split a text using 'delmiter _'

Like (1) ShareShare
ReportReport
Posted on 16 Sep 2024 10:27:02 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?
Categories:
  • Suggested answer
    eetuRobo Profile Picture
    3,273 Super User 2025 Season 1 on 17 Sep 2024 at 05:17:41
    How to split a text using 'delmiter _'
    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
  • Suggested answer
    Dominik Stalzer | primeone Profile Picture
    68 on 16 Sep 2024 at 11:20:49
    How to split a text using 'delmiter _'
    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]
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 18 Super User 2025 Season 1

#2
Nived_Nambiar Profile Picture

Nived_Nambiar 10 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 6

Overall leaderboard