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 / Exctract two Dates fro...
Power Automate
Answered

Exctract two Dates from email body

(0) ShareShare
ReportReport
Posted on by 4

Hi all!

 

i receive a mail with the following Body:

 

firstname lastname                  Ihr Antrag 'Urlaub': 09.07.2021  bis 09.07.2021  wurde genehmigt.

 

It's the information that my vacation was approved. 

 

I try to extract the first and secound date out of the text to create an event (to block my calendar) but something is not working...

I split the string after "'Urlaub':" so i receive "09.07.2021  bis 09.07.2021  wurde genehmigt." as an output.

Afterwards i want to split again at "  bis " but it says:

Unable to process template language expressions in action 'Compose_3' 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 do not find the solution to this... may somebody give me a hint? 🙂

 

Categories:
  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @FlorianWagner,

     

    Can you try and use this expression:

    split(split(split(outputs('Compose'), '''Urlaub'': ')[1], ' wurde genehmigt')[0], ' bis ')

     

    arraywithtwoitems.png

  • Verified answer
    Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @FlorianWagner,

     

    Probably a cleaner approach would be to just split on bis and use skip and take functions. Assuming that the date is always in 10 character format (dd.MM.yyyy) 😁

     

    First date

    skip(split(outputs('Compose'), ' bis ')[0], sub(length(split(outputs('Compose'), ' bis ')[0]),11))

     

    Second date

    take(split(outputs('Compose'), ' bis ')[1], 10)

     

  • FlorianWagner Profile Picture
    4 on at

    This Works!

    Thank you a lot!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard