Hi
I am unable to parse the 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
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
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
Hi
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.
Hi @Rina_22
Pls share the output array of 'split_bodytext' action. Is it containing single or multiple elements?
Thanks
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.'.
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')))
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
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1