Power Automate: Sick Message

Originally Posted 10/16/24

image of the power automate logo and the outlook logo. Power automate looks like a multicolored blue arrow pointing right, and outlook looks like a blue envelope with a letter coming out of it

The Problem

You've woken up sick. You feel absolutely awful and have decided the best thing to do is to go back to bed and rest for the day. However, your work phone/ computer is in another room, and you have to send the message from your work account or into a teams chat. You don't want to get out of bed, but you also need to call out from work.

The Solution

Setting up an automation with Power Automate that will automatically send a message to a Teams group chat (or wherever), telling your Boss/ Coworkers that you will be out sick for the day. In this tutorial I've chosen to use receiving an email from my personal email address as the trigger (I'll go into that more below), however given this is Power Automate, you should be able to do something similar with other microsoft apps as well. I'll list below the steps I have in my Power Automate and try to comment about what they're doing. To get to Power Automate, if your office uses Microsoft accounts, you can go office.com, sign into your account, and then in the top left click on the grid of boxes (they're in a 3x3 grid) which will show you apps you have access to. If you have access to power automate, you'd then click on it to open it. Once in Power Automate, you'd click "My Flows", and under "Cloud Flows" create a new flow, and choose "Automated Cloud Flow" under "Build your own from blank". Just give it a name and select the beginning trigger (my setup is below), and you can go from there!:

  1. When a new email Arrives (V3)- this is an Outlook option, so if you can't find it by title alone, try to find the Outlook options.
    • To (under Advanced Options): work.email+sick@workemailprovider.com
      • If you're not familiar with plus addressing, basically if you take an email address (like steventanzimedia@gmail.com) and put a "+" after the first part, you can put anything between the + and the @ and it should still go through to your email address. This is useful for sorting things. I've also seen the advice to do this when signing up for online services, so it's easy to track down which ones have sold your info to advertisers when you start getting random emails. So, for example, steventanzimedia+test@gmail.com should still get to my email.
    • From: personalemail@personalemailprovider.com
    • Subject Filter: Sick
  2. Current Time - this just grabs the current time
    • Upon testing this is actually kind of hard to find. The easiest way was searching for "Time" and choosing the "Date time" option. If you click the down arrow under the suggested apps to choose from, you can also find date time that way and choose this options. This also applies for the next step.
  3. Add to Time - this will become relevant in the next step
    • Base time: Choose the "Current Time" option from the list of "Dynamic Content"
    • Interval: 9 (our however many hours your shift is)
    • Time Unit: Hours (or whatever makes sense for you)
  4. Condition - Leave the "if no" path empty, and put the rest of the steps after this step into the "if yes" path.
    • You want the boxes under "Condition" to be setup to say "Body" (from the "Dynamic Content" list from the email) "contains" "Sick". This sets it so that if the received email contains the word "Sick" in the message portion, the flow will continue. If not, the flow does not continue.
  5. Create Event (V4) - you want the one with the Outlook symbol in case there are multiple options. Also this option is only required if you also want your calendar updated that you are out sick. If you do this step, this will then work in conjunction with the Power Automate: Out of Office Reply automation I spoke about a while ago.
    • Calendar ID: Whatever Calendar is the main one you use
    • Subject: Whatever you want the event name to be (I just put "Steven Out Sick" for example)
    • Start Time: Choose the "Current Time" option from the list of "Dynamic Content"
    • End Time: Choose the "Calculated time" from the list of "Dynamic Content"
    • Time Zone: Choose your time zone
    • Show as (under advanced options): oof (this will make it so you show as "out of office" on your calendar)
  6. Post message in a chat or channel - for my office, we usually just send a message in a teams chat to say when we are sick. If this is different for you, you could setup this step to send an email instead for example. Note: this is a Teams option, so it may be easier to just find the teams app image first.
    • Post as: User (so it looks like it came from you)
    • Post in: Group Chat (this is where I send my sick messages for my job)
    • Group Chat: Choose the Group Chat you want the message sent in
    • Message: Whatever message you want sent

Recap

Let's recap exactly what's happening in the automation above (note: the numbers below may not line up with the numbers above, just easy to explain things step by step):

  1. You send an email to your work email from your personal email.
    • The email should be formatted in the following way (for this automation to work):
      • To: workemail+sick@workemailprovider.com
      • Subject: sick
      • Body (Message): sick
    • I don't think "Sick" is key sensitive (I don't think it matters if it's capitalized or not), but you may want to test this ahead of time.
  2. Power Automate sees that an email has come in from your personal email. Based on the setup above, it is checking for a few things:
    1. Is it sent to this email with "+sick" added to it? (So, workemail+sick@workemailprovider.com)
    2. Is the word "Sick" in the Subject line?
    3. Is it from the personal email address in particular?
    • If yes to everything above, it moves on:
  3. Power automate collects Current time
  4. Power automate figures out what the current time plus 9 hours is
  5. Power automate checks to see if the received email contains the word "Sick" in the message body
    • At this point there are basically 4 things Power Auotmate is checking before sending a message/ changing your calendar: Was the email sent to "workemail+sick@workemailprovider.com", did the subject line contain the word "Sick", was it sent from "personalemail@personalemailprovider.com", and does the body contain "sick". All of this is so this automation does not go off by mistake
  6. If the received email does not contain the word "sick" in the message body, the automation stops
  7. If the received email does contain the word "Sick", the automation continues
  8. The automation then sets an event on your calendar starting from when the email is received until 9 hours from the time the email is received. It sets the event to be named whatever you called it, and sets your availability to "Out of Office"
  9. The Automation then sends a message in Teams letting people know you are sick.

Wrap Up

If you have any questions on this, or need assistance, please feel free to reach out to steventanzimedia@gmail.com! Or just let me know what you think about this setup.