Since last week I have been the proud driver of a Tesla Model 3. After first trying Autopilot and then experiencing the acceleration capacity, I started looking at the Tesla app. In it you can control everything on the car, but what you can’t do is create a schedule when the climate control must be turned on and off. After some research I found out that a Tesla API could be used and that is how I came up with the idea to heat / cool the Tesla based on my agenda.
Now I also block my travel time in my agenda so I can use that as a trigger. At every meeting in my agenda, Flow checks 5 minutes before time to see if the word ‘Reizen’ appears in the title (that is dutch for travel).
If it really concerns ‘Reizen’ then we will log in to my Tesla account and create an access token. With this token we have access to execute further commands to the car.
If the login is successful, I will save the access token. We then collect from Tesla which car(s) are connected to this account. Multiple cars can be linked to 1 account. In my Flow, however, I assume that it is only 1. You can also see that I use the access token in the header for authorization.
I then request the current status of the car. I do this because I want to check if someone is currently in the car and the car is locked. Of course I don’t want Flow to change the climate control if someone is driving. That’s why I check if nobody is present and the car is locked.
We are dealing with a battery-powered car. And I would like to get into a car with a nice temperature, but not if this means that I can then no longer drive because the battery is empty. Hence I first check whether the battery is more than 30% full.
Then I get the current climate status. With that data (current inside temperature and set climate control temperature) I can check whether the climate control should actually be on. If this deviates more than 2 degrees, I will continue with the Flow.
If all these conditions are met, I activate the climate control of the Tesla. This makes me nice and warm in the winter and I don’t have to scratch ice. And in the summer it is nice and cool.
I still have a 15 minute delay built in after the activation of the climate control. Of course I don’t want ‘Reizen’ to be in my agenda but for some reason I didn’t go. And then my climate control has been on indefinitely. That is why Flow checks after fifteen minutes if someone is in the car. If not, he switches the climate control off again.
It has probably happened to you too. You walk away from your workplace and you forget to lock it. Colleagues see that and to teach you a lesson, they send an email under your name to the department that you will treat cake tomorrow. One laughs about it, the other doesn’t…
The fact is that you have created an unsafe situation by not locking your workplace. Think about which websites you are already logged in by default, which programs you have open and which documents can be put on a USB stick.
Microsoft has created a feature in Windows 10 that helps you lock your workplace. Because what do you take 9 out of 10 times when you walk away…. your phone. And that is what Dynamic Lock checks for, which automatically locks your workplace as soon as your phone gets out of reach of your workplace.
Fortunately it’s not a requirement that your phone must be nearby to be able to log in. So it is only if your phone is nearby and has a Bluetooth connection with your laptop, and that connection is disconnected. Then your workplace locks.
You can test whether it works by walking away from your desk and when you return, your workplace must be locked. Now the range of Bluetooth per workplace and telephone is very different. It is therefore best to walk to a completely different floor or room.
See Dynamic Lock as a supplement to self-locking. The best thing of course is to lock your laptop yourself (for example with the key combination Windows key + L). But for those times you forget, Dynamic Lock makes sure you don’t have to buy a cake for the entire department.
PowerApps uses the rights of the user that started the PowerApp. And when the PowerApp loads it will ask the user for permission to use his account to connect to the different connections the PowerApp uses.
As an example, I created a PowerApp that retrieved and displayed different types of coffee from a SharePoint list. As soon as I share the PowerApp and open it with another user you get the following screen:
To ensure that the user does not receive this message, I have found a workaround using Flow. You can call a Flow from PowerApps and get data back from it. If you simply call a Flow from PowerApps and read the SharePoint list from that Flow, you will still receive this message. But if you call a Flow from PowerApps that calls on a second Flow, you will not get that message.
You do have to split the data that you receive from Flow because it is a string. So just save the data into a string and split the string to save it into an array.
I was watching episode 2 of the Flow Pro Show and they asked some MVP’s what there favorite flow feature is. And of course, I immediately asked myself the same thing. And I choose the HTTP action and HTTP trigger. With those 2, a world of possibilities opens up, including 2 flows that call on each other.
As soon as you select the When a HTTP request is received and you save the flow, flow creates a unique link. This flow starts every time this link is invoked. And so you can have other flows perform the HTTP action and thereby activate the other flow.
It is also possible to send information back and forth between flows. To demonstrate that, I made 2 flows.
Flow 1 calls to flow 2 with the text “Hello”
Flow 2 retrieves that info and adds ” World” to it
With the introduction of MS Teams within your company, you as an admin are faced with the decision whether you want to keep creating new teams open for everyone or not. By default, it is possible for anyone with a license to create a new team within MS Teams. If you do not want this and want to control the creation of MS Teams a bit more, it’s an option to create a Form with a Flow that handles the creation of a team with Microsoft Graph.
Step 1 – Manage who can create Office 365 Groups
First of all, you configure who can create new Office 365 groups. This also removes the option in MS Teams to create a new team. Microsoft has created this step-by-step plan for this.
Step 2 – Create an App registration in AzureAD
We are going to create the team with the create team function in the Microsoft Graph REST API. To be able to address this from Flow with application rights, we create an app registration with Group.ReadWrite.All rights.
In the Azure portal, go to Azure Active Directory and select App registrations. Click on the New application registration button and enter the details. A valid website must be entered in the Sign-on URL, but since we are going to address the app from Flow, this is not relevant. After creating, note the Application ID that has been created.
To grant the required rights to this app registration, click on the Settings button. Then click on Required permissions and then on Add. At item 1 Select an API you select Microsoft Graph. Under section 2 Select permissions, select Read and write all groups under the Application permissions heading. Then an admin must approve the rights by clicking on Grant permissions and confirming.
Next we will create a key by going to the menu option Keys. Under Passwords, enter a self-designed description in the Description field, select Never expires and click the Save button. Copy the key that is now displayed and save it properly. This is the only time this code is displayed.
Finally, we still need the tenant ID. You can find this by going into the Azure portal to Azure Active Directory. There you click on Properties and then you copy the Directory ID code. This is your tenant ID.
Depending on the last answer, I let the team name start with Dep- or Proj-. I do this to show that you can set up something of a naming convention for your teams. For example, you could also set the department name at the start of every teamname.
Step 4 – Create the Flow
Go to http://flow.microsoft.com and create a new blank flow. Use the When a new response is submitted from Microsoft Forms as a trigger and select the form that you just created in step 3. Then initialize 4 new string variables and enter the data from step 2 in the first 3 variables. The last variable iniStrTeamStart must remain empty.
Then create a new Get response details action and select the form that was created in step 3 again. InResponse Id, select the List of response notifications Response Id of the trigger. An Apply to each will now be created automatically.
Then create a Switch that looks at the value Kind of team?. Add the Department and Project options. Within those options we create a Set variable that changes the value StrTeamStartto Dep– or Proj-.
We then have to retrieve 1 more variable and that is the ID of the applicant. When creating the team, we must specify who should become the owner. I want to use the applicant for this, so we first request the user profile with the Get user profile (V2) action. Because I only need the ID of the applicant, not his name or anything, I fill the Select fields with ID.
And then we have arrived at the actual creation of the team. We use the HTTP action for this and will use it to perform a POST request to Microsoft Graph. The various properties of the new team are set in the body. In order to easily copy these properties, I also have them as text below the image. Note that if you have renamed the variables and/or actions, you will also have to adjust them when copying the body-text.
When you create Flows and PowerApps you often seek the help of Google. Sometimes it’s just easier to search for the solution on forums, YouTube or sites like this one. And when you do find a solution you will see that almost all of the examples are in English. At that time you don’t want to waste time and energy with searching for the translation of that particular action or formula. So if you haven’t done this already, change the language of your browser into English.
I use Google Chrome (love the profiles) for working with Flow and PowerApps. To change the language press the three dots in the top right and click on Settings (in you’re own language of course). A new page opens, click on the bottom on Advanced. Scroll down till you see the language settings section. Change it into English and restart the browser.
I have taught myself to change the name immediately with every new action that I add. I do this because I encounter a large flow that I created and lost the overview of what was happening where. Take, for example, the initialization of variables. If you have many variables and you do not rename the actions, it will look like this in no time:
Now try changing that specific variable from a string to an integer…
I don’t even make flows that long, but I already have a list of tricks. These are the things that make working with Flow easier. Especially if you want to adjust them later on. Start with saving the input in variables is one of those tricks.
Immediately at the start of your flow you start by initializing variables and saving the input of the flow in there. Later in the flow you then only use these variables. The big advantage of this is that it is much easier to adjust the trigger later. You can then change the trigger and only refill the variables at the beginning with the input of the new trigger. You do not have to make any further adjustments in the rest of your flow.