Update list when Send email with options sends successfully

%3CLINGO-SUB%20id%3D%22lingo-sub-325773%22%20slang%3D%22en-US%22%3EUpdate%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-325773%22%20slang%3D%22en-US%22%3E%3CP%3EFrom%20the%20docs%2C%20the%20%22Send%20email%20with%20options%22%20action%20%3CEM%3Esends%20an%20email%20with%20multiple%20options%20and%20waits%20for%20the%20recipient%20to%20respond%20back%20with%20one%20of%20the%20options.%3C%2FEM%3E%20I'm%20trying%20to%20log%20the%20sending%20action%20by%20updating%20a%20Yes%2FNo%20column%20and%20setting%20a%20date%20column%20with%20a%20timestamp.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESomething%20like%20this%3A%3C%2FP%3E%3CP%3E-%20Trigger%3A%20new%20item%20created%3C%2FP%3E%3CP%3E-%20Email%20sends%3C%2FP%3E%3CP%3E-%20list%20updates%20item%20that%20was%20created%2C%20sets%20%22email%20sent%22%20flag%20to%20%3CEM%3EYes%3C%2FEM%3E%2C%20sets%20timestamp.%3C%2FP%3E%3CP%3E-%20Recipient%20responds%2C%20capture%20response%20and%20update%20list%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%20the%20action%20waits%20until%20the%20response%2C%20so%20I%20cannot%20log%20when%20the%20email%20was%20actually%20sent.%20I%20don't%20want%20to%20do%20the%20update%20before%20the%20message%20is%20sent%2C%20because%20I%20want%20to%20make%20sure%20the%20send%20action%20is%20successful.%20But%20I%20don't%20want%20to%20wait%20until%20after%20the%20recipient%20of%20the%20message%20responds%2C%20because%20it's%20not%20accurate.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-325773%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326817%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326817%22%20slang%3D%22en-US%22%3E%3CP%3EFailures%20-%20Once%20or%20twice%20I've%20had%20it%20where%20the%20connection%2C%20ie.%20my%20credentials%2C%20%22expired%22%20(or%20something)%20and%20had%20to%20be%20refreshed%2C%20but%20you're%20right%2C%20it's%20not%20a%20common%20thing.%20I%20will%20probably%20look%20at%20a%20scheduled%20flow%20to%20capture%20any%20that%20are%20missed%2C%20and%20perhaps%20send%20myself%20a%20summary%20for%20review%20so%20I%20can%20see%20why%20things%20didn't%20work%20the%20first%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20and%20thankyou%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F115528%22%20target%3D%22_blank%22%3E%40Matt%20Coats%3C%2FA%3E%20for%20your%20help%20with%20this!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326815%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326815%22%20slang%3D%22en-US%22%3E%3CP%3EFrom%20my%20perspective%2C%20yes%20-%20someday%20it'll%20go%20wrong.%20But%20it's%20more%20for%20providing%20better%20data%20for%20the%20customer.%20When%20the%20customer%20looks%20at%20the%20list%2C%20they%20can%20see%20did%20the%20email%20send%2C%20when%20did%20it%20send%2C%20did%20the%20recipient%20responded%2C%20when%20did%20the%20recipient%20respond.%20The%20customer%20can%20start%20to%20get%20a%20feel%20for%20response%20times%2C%20and%20they%20have%20something%20that%20confirms%20the%20email%20actually%20sent%20without%20having%20to%20look%20into%20the%20flow%20logs.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326794%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326794%22%20slang%3D%22en-US%22%3E%3CP%3EAs%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F115528%22%20target%3D%22_blank%22%3E%40Matt%20Coats%3C%2FA%3E%26nbsp%3Bcorrect%20says%2C%20you%20don't%20necessarily%20need%20to%20run%20the%20parallel%20step%20if%20you're%20going%20to%20handle%20the%20error%20in%20the%20way%20we%20have%20discussed.%20Realistically%20there%20are%20only%20a%20couple%20of%20scenarios%20which%20I%20can%20think%20of%20off%20the%20top%20of%20my%20head%20which%20would%20result%20in%20failure%3A%3C%2FP%3E%3CUL%3E%3CLI%3EInvalid%2Fmissing%20email%20address%3C%2FLI%3E%3CLI%3EInvalid%2Fbroken%20connection%20associated%20with%20the%20action%3C%2FLI%3E%3C%2FUL%3E%3CP%3ETo%20pick%20up%20any%20that%20have%20failed%20you%20could%20either%20created%20a%20scheduled%20Flow%2C%20or%20you%20could%20consider%20starting%20the%20Flow%20directly%20from%20the%20list%20item%20itself.%20There%20are%20a%20number%20of%20options%20available%20to%20you%20depending%20on%20how%20you%20would%20like%20handle%20the%20errors.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326756%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326756%22%20slang%3D%22en-US%22%3ERecognizing%20that%20I'm%20only%20just%20now%20realizing%20that%20the%20%22wait%22%20you%20mentioned%20is%20buried%20in%20the%20%22Send%20Email%20with%20Options%22%20step%2C%20your%20plan%20makes%20sense.%20I%20don't%20know%20of%20a%20benefit%20to%20having%20the%20timestamp%20step%20being%20parallel%20(I'm%20assuming%20Prior%20To%20gets%20you%20the%20same%20result)%2C%20and%20it%20sounds%20like%20you've%20covered%20your%20bases%20in%20case%20of%20a%20failure%20by%20making%20a%20branch%20to%20clear%20out%20the%20timestamp%20and%20Email%20Sent%20status.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20what%20scenario%20might%20sending%20the%20email%20fail%3F%20Is%20that%20just%20the%20assumption%20that%20something%2C%20someday%2C%20always%20goes%20wrong%2C%20or%20is%20there%20something%20about%20your%20process%20that%20leaves%20open%20the%20possibility%20of%20an%20address%20being%20invalid%20or%20unavailable%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326651%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326651%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20if%20I%20combine%20your%202%20suggestions%20I%20can%20get%20what%20I%20want.%20If%20I%20update%20the%20%22Email%20Sent%22%20flag%20and%20set%20a%20timestamp%20parallel%20to%20(or%20prior%20to)%20the%20send%20email%20with%20options%2C%20I%20assume%20it%20will%20send%20successfully%20and%20it%20logs%20the%20info%20accordingly.%20Then%20on%20fail%20I%20can%20update%20%22Email%20Sent%22%20to%26nbsp%3B%3CEM%3ENo%3C%2FEM%3E%20and%20clear%20out%20%22Email%20Sent%20Date%22.%20That%20would%20let%20me%20run%20a%20recurrence%20and%20I%20could%20re-try%20those%20fails%20automatically%20by%20querying%20the%20list%20for%20any%20items%20where%20%22Email%20Sent%22%20equals%20%22No%22.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20see%20any%20problems%20with%20that%20approach%20or%20any%26nbsp%3B%3CEM%3Egotchas%3C%2FEM%3E%20I%20might%20be%20missing%20or%20failing%20to%20consider%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326620%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326620%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20could%20always%20work%20on%20the%20assumption%20that%20it%20fails%2C%20and%20handle%20the%20error%20of%20the%20email%20being%20sent%20accordingly%20(See%20screenshot).%20If%20the%20email%20is%20going%20to%20fail%20to%20send%2C%20you'll%20get%20the%20failure%20almost%20immediately%20and%20so%20you%20can%20a%20further%20update%20to%20either%20log%20the%20error%20in%20the%20list%20or%20remove%20the%20sent%20date.%20This%20would%20be%20your%20%22has%20failed%22%20step%2C%20whereas%20the%20%22is%20successful%22%20will%20continue%20to%20wait%20until%20the%20response%20comes%20back.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20not%20quite%20the%20nice%20and%20shiny%20solution%20which%20you're%20looking%20for%20but%20it%20should%20do%20the%20job.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326619%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326619%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20could%20always%20work%20on%20the%20assumption%20that%20it%20fails%2C%20and%20handle%20the%20error%20of%20the%20email%20being%20sent%20accordingly%20(See%20screenshot).%20If%20the%20email%20is%20going%20to%20fail%20to%20send%2C%20you'll%20get%20the%20failure%20almost%20immediately%20and%20so%20you%20can%20a%20further%20update%20to%20either%20log%20the%20error%20in%20the%20list%20or%20remove%20the%20sent%20date.%20This%20would%20be%20your%20%22has%20failed%22%20step%2C%20whereas%20the%20%22is%20successful%22%20will%20continue%20to%20wait%20until%20the%20response%20comes%20back.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20not%20quite%20the%20nice%20and%20shiny%20solution%20which%20you're%20looking%20for%20but%20it%20should%20do%20the%20job.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326618%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326618%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20actually%20trying%20to%20log%20when%20the%20email%20was%20sent%20AND%20when%20the%20recipient%20response.%20I'd%20like%20to%20have%20a%20view%20where%20it%20shows%20all%20the%20info%20-%20email%20sent%20(yes%2Fno)%2C%20email%20sent%20date%2C%20response%20(a%2C%20b%2C%20or%20c)%2C%20response%20date.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20theory%20I%20could%20set%20a%20variable%20when%20the%20send%20email%20runs%20and%20update%20the%20list%20after%20the%20response%20using%20that%20variable%2C%20but%20it%20doesn't%20give%20the%20visibility%20I'm%20after%20to%20know%20which%20items%20have%20had%20an%20email%20sent%20but%20not%20responded%20to.%20Hopefully%20that%20makes%20sense%20and%20adds%20some%20clarity.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326617%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326617%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20problem%20with%20that%20approach%20is%20it%20doesn't%20actually%20tell%20me%20if%20the%20email%20was%20successfully%20sent.%20It%20only%20tells%20me%20when%20the%20flow%20ran.%20So%20one%20branch%2C%20the%20update%2C%20could%20be%20successful%2C%20but%20the%20other%20branch%2C%20which%20sends%20the%20email%2C%20might%20not%20be%20successful.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326611%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326611%22%20slang%3D%22en-US%22%3E%3CP%3EWhat%20if%20you%20used%20a%20proxy%20timestamp%20instead%3F%20If%20you're%20willing%20to%20sacrifice%20up%20to%20a%20couple%20seconds%2C%20you%20can%20use%20the%20Current%20Time%20action%20immediately%20after%20your%20Send%20Email%20with%20Options%20action%20is%20completed%20and%20use%20that%20to%20populate%20your%20%22Email%20Sent%22%20field%20in%20your%20List.%3C%2FP%3E%3CP%3E*Possibly%20dumb%20question%2C%20are%20you%20trying%20to%20log%20the%20time%20the%20email%20was%20sent%2C%20or%20the%20time%20that%20the%20recipient%20of%20the%20Send%20Email%20with%20Options%20email%20responds%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-326609%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20list%20when%20Send%20email%20with%20options%20sends%20successfully%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-326609%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62058%22%20target%3D%22_blank%22%3E%40Jason%20Barnes%3C%2FA%3E%26nbsp%3B%20you%20could%20consider%20a%20parallel%20action%20which%20runs%20at%20the%20same%20time%20as%20the%20send%20email%20(see%20screenshot).%20So%20run%20the%20first%20update%20to%20the%20list%20item%20which%20runs%20concurrently%20with%20the%20sending%20of%20the%20email%2C%20and%20then%20update%20based%20on%20the%20response%20once%20the%20email%20button%20is%20clicked%20by%20the%20user.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

From the docs, the "Send email with options" action sends an email with multiple options and waits for the recipient to respond back with one of the options. I'm trying to log the sending action by updating a Yes/No column and setting a date column with a timestamp.

 

Something like this:

- Trigger: new item created

- Email sends

- list updates item that was created, sets "email sent" flag to Yes, sets timestamp.

- Recipient responds, capture response and update list

 

Unfortunately the action waits until the response, so I cannot log when the email was actually sent. I don't want to do the update before the message is sent, because I want to make sure the send action is successful. But I don't want to wait until after the recipient of the message responds, because it's not accurate.

 

Any suggestions?

11 Replies
Highlighted

Hi @Jason Barnes  you could consider a parallel action which runs at the same time as the send email (see screenshot). So run the first update to the list item which runs concurrently with the sending of the email, and then update based on the response once the email button is clicked by the user.

Highlighted

What if you used a proxy timestamp instead? If you're willing to sacrifice up to a couple seconds, you can use the Current Time action immediately after your Send Email with Options action is completed and use that to populate your "Email Sent" field in your List.

*Possibly dumb question, are you trying to log the time the email was sent, or the time that the recipient of the Send Email with Options email responds?

Highlighted

The problem with that approach is it doesn't actually tell me if the email was successfully sent. It only tells me when the flow ran. So one branch, the update, could be successful, but the other branch, which sends the email, might not be successful.

Highlighted

I'm actually trying to log when the email was sent AND when the recipient response. I'd like to have a view where it shows all the info - email sent (yes/no), email sent date, response (a, b, or c), response date.

 

In theory I could set a variable when the send email runs and update the list after the response using that variable, but it doesn't give the visibility I'm after to know which items have had an email sent but not responded to. Hopefully that makes sense and adds some clarity.

Highlighted

You could always work on the assumption that it fails, and handle the error of the email being sent accordingly (See screenshot). If the email is going to fail to send, you'll get the failure almost immediately and so you can a further update to either log the error in the list or remove the sent date. This would be your "has failed" step, whereas the "is successful" will continue to wait until the response comes back.

 

It's not quite the nice and shiny solution which you're looking for but it should do the job.

Highlighted

You could always work on the assumption that it fails, and handle the error of the email being sent accordingly (See screenshot). If the email is going to fail to send, you'll get the failure almost immediately and so you can a further update to either log the error in the list or remove the sent date. This would be your "has failed" step, whereas the "is successful" will continue to wait until the response comes back.

 

It's not quite the nice and shiny solution which you're looking for but it should do the job.

Highlighted

I think if I combine your 2 suggestions I can get what I want. If I update the "Email Sent" flag and set a timestamp parallel to (or prior to) the send email with options, I assume it will send successfully and it logs the info accordingly. Then on fail I can update "Email Sent" to No and clear out "Email Sent Date". That would let me run a recurrence and I could re-try those fails automatically by querying the list for any items where "Email Sent" equals "No". 

 

Do you see any problems with that approach or any gotchas I might be missing or failing to consider?

Highlighted
Recognizing that I'm only just now realizing that the "wait" you mentioned is buried in the "Send Email with Options" step, your plan makes sense. I don't know of a benefit to having the timestamp step being parallel (I'm assuming Prior To gets you the same result), and it sounds like you've covered your bases in case of a failure by making a branch to clear out the timestamp and Email Sent status.

In what scenario might sending the email fail? Is that just the assumption that something, someday, always goes wrong, or is there something about your process that leaves open the possibility of an address being invalid or unavailable?
Highlighted

As @Matt Coats correct says, you don't necessarily need to run the parallel step if you're going to handle the error in the way we have discussed. Realistically there are only a couple of scenarios which I can think of off the top of my head which would result in failure:

  • Invalid/missing email address
  • Invalid/broken connection associated with the action

To pick up any that have failed you could either created a scheduled Flow, or you could consider starting the Flow directly from the list item itself. There are a number of options available to you depending on how you would like handle the errors.

Highlighted

From my perspective, yes - someday it'll go wrong. But it's more for providing better data for the customer. When the customer looks at the list, they can see did the email send, when did it send, did the recipient responded, when did the recipient respond. The customer can start to get a feel for response times, and they have something that confirms the email actually sent without having to look into the flow logs.

Highlighted

Failures - Once or twice I've had it where the connection, ie. my credentials, "expired" (or something) and had to be refreshed, but you're right, it's not a common thing. I will probably look at a scheduled flow to capture any that are missed, and perhaps send myself a summary for review so I can see why things didn't work the first time.

 

Thank you and thankyou to @Matt Coats for your help with this!