cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris_tortuga
Regular Visitor

Help Needed: Get Events and Send an Email Issue

I want a flow that Gets Items (Phone Appointments) from the Outlook calendar and emails the customer a follow-up survey.

 

It works if there is one customer appointment at a time on the schedule. However, my problem is that if more than one customer is scheduled at the same time, multiple emails are sent, but all the individual emails are sent to the first customer email.

 

For example, if 3 individual customers are scheduled at 10am: Customer A, Customer B, and Customer C. My flow is emailing Customer A, Customer A, and Customer A.

 

What could be my issue?

 

Here is the calendar (for an example):

chris_tortuga_0-1620069418254.png

 

Here is the flow:

chris_tortuga_1-1620069418255.png

 

chris_tortuga_2-1620069418532.png

 

chris_tortuga_3-1620069418255.png

 

Here is my expanded Get Bookings (if needed):

chris_tortuga_5-1620069459929.png

 

If you need additional screenshots or information, just let me know!

 

Thank you in advance!! 

 

Chris

5 REPLIES 5
majorfriend
Advocate II
Advocate II

This is a shot in the dark for me as I'm still fairly novice with Power Automate, but I would guess it has something to do with the way your variables are being defined. Could you add a screenshot for how your customer email variable is defined?

chris_tortuga
Regular Visitor

Here are some screenshots of Customer Email expanded:

chris_tortuga_1-1620082836511.png

 

 

chris_tortuga_0-1620082739325.png

 
Here is the expression that is is pulling from the Outlook appointment:
trim(last(split(first(split(outputs('Html_to_text')?['body'],'Phone')),'Email: ')))

Ok, like I said novice here without a lot of experience with variables. So just throwing some ideas at the wall here:

First can you move your send an email inside your apply to each and test again?

 

If that doesn't work can you look at your run history, and go to the third item in your apply to each, then look at your customer email variable, what is the output there? Is it showing Customer C's email, I would think it must be showing Customer A's email since that is where is emailing to.

Lastly, I'm thinking it might make more sense to use compose instead of variables. So you would have something like:
Get booking>apply to each(>html to text>compose customer email>compose customer name>etc>get staff members>add to html table>send email)

chris_tortuga
Regular Visitor

I moved Send an Email inside Apply to Each.

 

Tested with two appointments at 7:30pm. Two emails were sent to the first customer appointment, none to the second customer. 😞

Ok, I set up a test on my end.

My flow actually runs twice (once for each appointment I set up)

 

Both appt 1 and appt 2 trigger a flow run, but my "Get events" step only pulls appt 2, thus customer 2 gets two emails (I believe this is due to an issue with query, but can't say for sure).

 

So, I just deleted the "get events" step and now both customers are getting emails (one off of each flow run).

Here is what I did (though mine is simplified for testing purposes)

 

Capture6.JPG

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,519)