Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
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,435 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 161 Super User 2025 Season 1

#2
Riyaz_riz11 Profile Picture

Riyaz_riz11 58 Super User 2025 Season 1

#3
CU12050101-0 Profile Picture

CU12050101-0 34

Overall leaderboard
Loading started