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 / unable to parse two te...
Power Automate
Unanswered

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

 

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    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

  • grantjenkins Profile Picture
    11,063 Moderator on at

    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')))
  • Rina_22 Profile Picture
    6 on at

    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.'.

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    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

    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

     

  • Rina_22 Profile Picture
    6 on at

    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

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    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

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    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

     

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard