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

Extract Substring between specified characters

(0) ShareShare
ReportReport
Posted on by

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
    on at

    .

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

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    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

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard