INTRODUCTION (1/3) : Build your first Power Automate flow
Automatically receive an email when a new record is added to a SharePoint list.
Let me introduce your future favorite tool.
Power Automate.
I could explain in a 40-line paragraph just how amazing it is. However, if you're not familiar with it yet, the best way to discover its capabilities is to see firsthand what it can do for you.
Let's dive right in if you're ready.
Prerequisite Software:
SharePoint
Chapter 1: Create a SharePoint List
We've already created a list in the first tutorial below:
You'll be able to reuse it starting from Chapter 2, but I suggest getting familiar with creating lists in SharePoint by following Chapter 1.
Let's create a new list using the Star Wars universe, which, as you'll see, is very useful for learning certain concepts.
Go to your SharePoint site and select + New, then List.
Choose "Blank list" and name it, for example, “Star Wars Data”.
Our list is now created, and we can start adding content.
Let's think about the information that might interest us:
Character's name
Affiliation (Republic, Rebellion, Separatists, Empire)
Job
Color of their lightsaber if they have one
We could add more fields, but we'll address that in another tutorial.
First, click on the 'Title' column and rename it to 'Name' before saving.
Next, click on 'Add a column,' select the 'Choice' type, and then press 'Next.'
Let's fill in the column details on the side.
We add the column name 'Affiliation,' a description, the four factions, and make this field mandatory.
Let's add a new 'Choice' column that we will name 'Job.' Here, we will add the various occupations that characterize the main characters in Star Wars.
Here's what your column should look like:
Perhaps we have forgotten some occupations? That's not a big deal; we can always add more later if necessary.
We just need to add the lightsaber color by creating a 'Lightsaber color' column and adding different colors (be careful not to make the column mandatory as some characters don't have one):
An idea just struck me: let's also create a 'Master' column to associate an apprentice with a master if such a configuration exists.
This time, the column will not be of the 'Choice' type but rather of the 'Lookup' type.
Let's name it 'Master' and select our “Star Wars Data” list. Leave 'Title' as the column to search for. This is nothing more than the 'Name' column, which was 'Title' before we renamed it.
This column will not be mandatory since not all our heroes necessarily have an associated master.
To prevent accidental deletions, let's add another parameter that makes it impossible to delete characters considered as masters:
Perfect, how about adding your first character?
Let's add Obi-Wan Kenobi, for example.
We know that Obi-Wan has the following characteristics:
Name: Obi-Wan Kenobi
Affiliation: Republic
Job: Jedi
Lightsaber color: Blue
Master: (leave it empty since Qui-Gon Jinn is not in our records)
Here's our first entry:
Let's add a second one, Anakin Skywalker, for example.
Anakin has the following characteristics:
Name: Anakin Skywalker
Affiliation: Republic
Job: Jedi
Lightsaber color: Blue
Master: Obi-Wan Kenobi (Our first master with the lookup function!)
As you can see, when adding Anakin, Obi-Wan is selectable in the Master field.
Our list is up and running, and we have two records. It's time to move on to Power Automate.
Chapter 2: Connecting to Power Automate
First, let's go to the following link (I recommend right-clicking and opening it in a new tab to avoid losing this page):
Log in with your Microsoft account until you land on this page:
It would take dozens of tutorials to explore Power Automate fully.
I suggest learning by doing rather than bombarding you with information that may seem abstract at the moment.
But before anything else, let's configure your Power Automate to look like mine.
Go to the settings in the top right and select: View all Power Automate settings:
In the window that showed up, select Experimental Features.
Click 'Save' and go to the 'Create' section on the left.
Here, we can create a new flow.
What's a flow, you might ask? It's a set of actions we instruct Power Automate to follow so that it works for us.
For example, we could tell it:
“When a character is added to my SharePoint list “Star Wars Data”, send me an email to notify me.”
And guess what? That's exactly what we're going to do!
We have three types of flows at our disposal:
Automated flow: It triggers when a specific event occurs (e.g., a new record in a SharePoint list).
Instant flow: It only triggers when you press a button.
Scheduled flow: It triggers at a specified frequency, such as daily at 9 AM.
In our example, it’s obvious that we will take the automated flow.
Once you've clicked on it, you need to add a name for your flow and select a 'trigger' action. Since it's an automated flow, we have quite a wide selection.
For our example, we want an automation to run when a new hero is added to our 'Star Wars Data' list.
So, we will select: “When an item is created” (with the SharePoint logo), as shown below:
After clicking on Create, you will find yourself on the flow editing page. This is where we will tell Power Automate what we want it to do.
You can see that we have the trigger we selected earlier.
We need to add our SharePoint in the 'Site Address' field and our 'Star Wars Data' list in the 'List Name' field.
Your trigger should look like this:
Now, we will add an action. To do this, click on 'New step' below your trigger. A list of several actions should appear. If you're curious, you might notice that there are hundreds (or perhaps even thousands) of them. Power Automate has many features that can assist you in your daily work.
In our case, we will choose “Send an email (V2)”, which you can find by typing 'email' or 'outlook' in the search bar to select an action.
The action we just added allows you to send an email automatically with a template that we will define.
First, we can add a recipient. There are two ways to do this:
Manually add a contact's email by typing it in the 'To' field. For example: yourmail@youraddress.com
Use one of Power Automate's best features: add the email 'dynamically.'
To do this, click on the logo with the two arrows ('Switch to Advanced mode') as shown below:
Then, click on the logo with the lightning bolt and lines ('Add a dynamic value').
Here, a list unfolds with two options available. For example, we want to send an email to the person who created the new hero in our list. So, we will click on 'Created By Email.'
Power Automate provides an indication of the nature of this 'dynamic value': the email address of the person who created the item in the SharePoint list.
Once that's done, your dynamic value has been added as the email recipient, as shown below:
Let's use the same approach to add a subject to our email. For example, we want to have the character's name as the first part of the email subject.
Since we can't know in advance who the character will be, we'll add... a dynamic value.
Click on the 'Subject' field and go back to the dynamic values.
Choose 'Title' (which is actually our 'Name' column, but Power Automate seems to have retained the original name of the column), and then manually write:
“has been added to the list”, as shown below:
Let's also complete the body of our email by adding some information about our new character.
We'll do it in the same way by choosing the dynamic values we're interested in.
Remember: when you have the choice between 'Lightsaber Color' or 'Lightsaber Color Value,' ALWAYS choose the one ending with Value.
(Otherwise, the email recipients will see more or less strange code).
Click 'Save' below your “Send an email (V2)” action, and let's launch our first automation.
When the message indicating that your flow is ready to go appears, click the arrow in the top left to return to our flow control screen.
Select “Don’t show me this again” and click on “Got it” :
All that's left is to see if our flow works by going back to our SharePoint list and adding a new hero to our list.
For example, let's choose Ahsoka Tano.
Here's what our record should look like:
Click 'Save' and make sure that our hero has been added next to the others:
Next, go to your Outlook and wait a few moments until you receive... an email from yourself.
Open it, and you'll see that our automation has indeed worked!
The information is clearly displayed as we specified in the flow:
Congratulations, your first flow with Power Automate is complete. If you want to deactivate it, go to the flow control screen and select 'Turn off' at the top: