Skip to main content


Power Platform integration forum
Suggested answer

extracting an #ID from email subject

Posted on by
I have a flow that I would like to use to update a list item. The ID of the item is contained within the email subject in this form: /#REF1234 Whatever subject follows/ where 1234 is the id. I am looking for the proper function to isolate the ID following #REF from the string this could be any number of digits following #REF. I am unsure one function alone can achieve this, I tried searching a bit and array might seem to be one way to go but i wasn't exactly sure where to start.
  • Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    extracting an #ID from email subject
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
  • Suggested answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    extracting an #ID from email subject
    Is the format of your subject field values fixed?
    For example: #REF1234 space Whatever subject follows
    The #REF always comes first, followed immediately by the ID, then a space followed by the text.
    If so, then you can use the following expression.
    slice(outputs('Get_a_row_by_ID')?['body/subject'], 4, indexOf(outputs('Get_a_row_by_ID')?['body/subject'], ' '))
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
    Best Regards,
    Dengliang Li

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,737 Super User

Martin Dráb Profile Picture

Martin Dráb 225,254 Super User

nmaenpaa Profile Picture

nmaenpaa 101,146


Product updates

Dynamics 365 release plans