Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

unable to parse two text in email body

(0) ShareShare
ReportReport
Posted on by 6

Hi 

 

I am unable to parse the email body.

 

 "body""Ref : CAM/2023/686/AE\n\n \n\n15 December 2023
 
I am able to get the ref number but not the date- the expressions used: last(split(outputs('split_bodytext')[1],': '))
 
Rina_22_0-1703151719714.png

 

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: unable to parse two text in email body

    Hi @Rina_22 ,

     

    You could try this regular expression to accurately match dates in a segment of text.

    \b[0-3]?[0-9] (January|February|March|April|May|June|July|August|September|October|November|December) (1|2)\d{3}\b

    About how to use regular expression in power automate:

    https://andersjensen.org/how-to-use-regex-in-power-automate/

     

    Best Regards,

    Bof

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: unable to parse two text in email body

    Hi @Rina_22 

     

    Pls try this one:

    trim(join(reverse(take(reverse(split(first(outputs('split_bodytext')),' ')),3)),' '))

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Rina_22 Profile Picture
    6 on at
    Re: unable to parse two text in email body

    Hi 

     

    Both dont work. it is taking the reference no. instead of the date.

     

     "body""Ref : CAM/2023/686/AE\n\n \n\n15 December 2023

  • Rina_22 Profile Picture
    6 on at
    Re: unable to parse two text in email body

    Hi

     

    Rina_22_1-1703161806773.png

     

    Reference

    this is the expression: last(split(outputs('split_bodytext')[0],': '))

     

    Date

    trim(join(reverse(take(reverse(split(outputs('reference'),' ')),3)),' '))

     

     

    The output is showing the reference no. instead.

    Rina_22_0-1703161536200.png

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: unable to parse two text in email body

    Hi @Rina_22 

     

    Pls share the output array of 'split_bodytext' action. Is it containing single or multiple elements?

     

    Thanks

  • Rina_22 Profile Picture
    6 on at
    Re: unable to parse two text in email body

    HI

     

    thank you, but it doesnt work. Here is the error message:

    Unable to process template language expressions in action 'Date' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Array'. Please see https://aka.ms/logicexpressions#split for usage details.'.

  • grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: unable to parse two text in email body

    I would try one of the following (depending on how it's storing your new line characters).

     

    last(split(outputs('split_bodytext'), '\n'))
    
    last(split(outputs('split_bodytext'), decodeUriComponent('%0A')))
  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: unable to parse two text in email body

    Hi @Rina_22 

     

    Pls try the below expression:

    trim(join(reverse(take(reverse(split(outputs('split_bodytext'),' ')),3)),' '))

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

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

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1