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 / Extract Substring betw...
Power Automate
Answered

Extract Substring between specified characters

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey, all!

 

I’ll try to keep it brief, but I am fairly new to power automate and building flows. My questions are based off pdf file names that will be formatted as:

999-20220602-1–J 

 

I was able to set up my first substring to pull the first characters of an uploaded pdf into a specified column(RM), but the RM number can be between 1-4 digits so my current formula won’t work. Essentially I need a function to give me everything prior to the first hyphen.

 

My second issue is pulling the numbers between the first two hyphens and having that populate in the Receipt Date column. (I know the expression I made in the picture is nonsense, I was just burnt out from researching & was throwing poop at the proverbial wall😂)

 

From what I’ve read in other posts I may need to index, but as I said, I’m pretty new at this and would appreciate any help I can get!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    .

    91C05D65-9D6A-46CB-B0AB-9084F3D42093.jpeg

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Do you want to extract substrings from the file name of a new created file?

    Could you please share a bit more about your scenario?

     

    Here is something about the substring:

    1). To get the complete string prior to the first hyphen, you should combine the first() with the split():

    first(split(outputs('Compose'),'-'))

    Note that you could replace the outputs('Compose') with the file name from the dynamic content tab.

    vqiaqimsft_0-1654493626407.png

    2). To get each string split by the hyphen, you just need to use the variables() as below:

    vqiaqimsft_2-1654495077616.png

    variables('FileName')[1]

    vqiaqimsft_1-1654494981767.png

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