November first I started at a new company, Motion10 in Rotterdam, as Functional Consultant. The first week I followed a really cool introduction week to get to know the company and my new colleagues. After a couple days a colleague said: please call me in the car so we can talk whilst I’m driving. Ok, I unlock my new mobile phone but.. there are no contacts! Luckily I was able to find his phone number in Delve, but how cool would it be to have all my colleagues added automatically in my own Outlook address book.
So my new project started…
Reading-time: 3 minutes
Using Microsoft Flow
- Open Flow from your Office365 dashboard (https://portal.office.com)
- Open a new blank flow
- First we need to add a trigger. This can by anything, but for now I’m using the manually button.
- Second we are going to use a action from the Excel connector, Get Rows
- Create a new Excel document in your OneDrive (or somewhere else) and create a new table in the Excel document. You can call this table: Emailaddresses
- Add your email address to this table so we can test it first with one user.
- Select this Excel document in the Excel Action parameters (Screenshot 1)
- The next action is an Apply to each loop. We want to loop every row in the Excel table to create a new contact
- In the first parameter select the value item from the previous Excel Action (Screenshot 1)
- In this Apply to Each loop we can add sub-actions. Every sub-action will be executed when a row was found in the Excel document
- Add the sub-action Get user profile From the Office365 users connector
- At the parameter UPN you can select the table name from the excel document (Screenshot 2)
- The second sub-action is Create contact from the Office365 Outlook connector (Screenshot 3)
- You can fill in all the parameters you want from the previous sub-action “Get user profile”
- The businessPhone number is difficult, because we get a table with phone numbers instead of one phone number. That’s why we need a new Apply to each loop to find every phone number. This is how we can create this:
- Add a new sub-action Edit contact from the Office365 Outlook connector
- Select the ID from the previous new contact action so we edit the same contact
- Add the parameter phone number and select businessPhones -Item from the get user action
- As you can see you get a new Apply to each loop, so for each found phone number he will follow this process (screenshot 4 and 5)
- The Task is done and you can test the flow.