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 email subject ...
Power Automate
Answered

Extract email subject from specific starting position

(0) ShareShare
ReportReport
Posted on by 7

Hi,

I would like to extract email subject from specific starting position, 

The email subject examples were as below:
BC1234-5678 #1234 document update 
KT1234-5678 #3456 please file this document

I would like to extract the subject as marked in red in above examples (that is, starting from 6th position after # mark),
then which formula should I use?
Thank you in advance!

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @leoleo1,

    Do you want to extract special strings from the subject?

     

    If you the strings starts at the 6th position after # mark, I think you could always use the following formula:

    substring(Last(split(outputs('Compose'),'#')),5)

    Note that the Compose is where I save the email subject.

     

  • leoleo1 Profile Picture
    7 on at

    Thanks for your reply,
    i tried to use "compose" function and then pasted the below formula:

    substring(Last(split(outputs('triggerOutputs()?['body/subject']'),'#')),5)
    However the system showed error.
    leoleo1_0-1666358129062.png

    May I know if its correct to use "compose" function? Or which function should I select in the flow.
    (Sorry I am really new to this system...)

    THank you!

  • leoleo1 Profile Picture
    7 on at

    Thanks for your reply,
    i tried to use "compose" function and then pasted the below formula:

    substring(Last(split(outputs('triggerOutputs()?['body/subject']'),'#')),5)
    However the system showed error.
    leoleo1_0-1666412926720.png

     

    May I know if its correct to use "compose" function? Or which function should I select in the flow.
    (Sorry I am really new to this system...)

    THank you!

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

    Hi @leoleo1,

    Compose is a control instead of a function.

    In my scenario, I put the subject from the email into a Compose control, so I could refer to compose directly.

    vqiaqimsft_0-1666575382901.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 594

#2
Valantis Profile Picture

Valantis 469

#3
11manish Profile Picture

11manish 364

Last 30 days Overall leaderboard