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
Helper II
Helper 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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,093)