cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
FryFubar
Level: Powered On

Create calendar appointment when new email arrives

I've recently started using MS Flows to automate various processes, but I'm stumped on this latest concept.

 

We get automated emails from a specific email address at work, from which my team manually creates a calendar appointment.

 

We copy the email body into the calendar body. Easy with Flow.

 

The subject, reminder, reoccurence and attendees are always the same. Again, nice and easy.

 

Where we're struggling is with the Start Time and Date, End Time and Date and Location. We need these fields populated from the body of the email. 

 

Does anyone know how to pull text from the email body and populate the calendar fields? The text is always there, but is obviously different with each email.

 

 

4 REPLIES 4
Community Support Team
Community Support Team

Re: Create calendar appointment when new email arrives

Hi @ FryFubar,

 

Could you please share a bit more details about the email that you would receive?

Could you please share more details about the start time and end time in the email?

 

Maybe you could use the connector “Data Operations” and workflow definition language to extract “certain fields” from the body of the email.

Please provide more information about your requirement so I could try to help you.

I have made a test on my side, the email’s body as below:

 

Hi, a new appointment event should be created.

start time:2018-03-18T14:00:00

end time: 2018-03-18T16:00:00

location: meeting room 4-003

 

 

If I want to get the value of start time “2018-03-18T14:00:00” and end time “2018-03-18T16:00:00”from the body of the email, and use the start time and end time to create an event, I could create a flow as below:

2.png3.png

 

  1. Add a trigger “When a new email arrives”.
  2. Add a Compose, choose the “Body dynamic” content of the trigger in the input field.
  3. Add a compose 2, the expression of the compose 2 as below:

split(outputs('Compose'),'start time:')?[1]

 

4. Add a compose 3, the expression of the compose 3 as below:

split(outputs('Compose_2'),'</p>')

 

5.Add a compose 4, rename the Compose 4 to “start time”, the expression of the “start time” as below:

outputs('Compose_3')?[0]

 

6.Add a compose 5, rename the Compose 5 to “end time”, the expression of the “end time” as below:

      split(outputs('Compose_3')?[1],'end time:')?[1]

 

7.Add a compose 6, rename the Compose 6 to “location”, the expression of the “location” as below:

      split(outputs('Compose_3')?[2],'location:')?[1]

 

8.Add an action “Create event(V2)”of office 365 outlook, fill in the subject and choose the Calendar id of the event, choose the “Output” dynamic content of the “start time” action in the “Start time” field, choose the “Output” dynamic content of the “end time” action in the “End time” field, choose the “Output” dynamic content of the “location” action in the “Location” field, fill in the reminder, reoccurence and attendees.

 

When a new email arrives, the flow would run successfully as below:

4.png5.png

 

The event would be created in the outlook calendar as below:

6.png

 

 

 

Regards,
Alice Zhang

FryFubar
Level: Powered On

Re: Create calendar appointment when new email arrives

Alice, thank you so much for this suggestion. I will put some time aside tonight to try this out. I'll let you know if this works for me, but thanks for taking the time to go to this level of detail! Outstanding 👍

FryFubar
Level: Powered On

Re: Create calendar appointment when new email arrives

Using your example, I've copied the trigger and actions, but obviously it doesn't work as my content is different. Please could you help me decypher your expressions to better fit the sample email below? I've italisied any sensitive content:

 

Spoiler

Dear Leased Circuit Customer,

 

We have been notified of planned maintenance affecting your leased line service, the details of which are included below.

 

Affected installation address:

 

1st Line

2nd Line

City

Post Code

 

Associated Order ID: OrderNumber

 

Maintenance window start: Tue 3rd April 2018 00:01 BST Maintenance window end: Wed 4th April 2018 06:00 BST

 

Expected impact duration: 1 hour and 15 minutes

 

Reason given for maintenance:

Supplier Upgrade Maintenance

 

Your service will be at risk of additional or extended outages for the duration of the maintenance window.

 

If you have any queries regarding this maintenance, please contact our Network Operations Centre using the details below.

 

We apologise for any inconvenience this may cause.

 

Kind Regards,

 

Signature

 

 

 

FryFubar
Level: Powered On

Re: Create calendar appointment when new email arrives

@v-yuazh-msft, forgive me for being so bold, could you take a look at the email body for me? Pretty please Smiley Very Happy

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 287 members 2,925 guests
Please welcome our newest community members: