Import Microsoft 365 Users into Contacts List of HelpDesk for SharePoint Online Using Power Automate (Microsoft Flow)

Power Automate (Microsoft Flow) is a universal tool for creating automated processes in which different apps and services can interact with each other. Since Plumsail HelpDesk has got own connector for it with a bunch of actions, it widens automation opportunities of a HelpDesk service based on our product. In this article, I will review configuring of a flow for importing of Microsoft 365 users into a HelpDesk contacts list or for updating the latter. In most cases, there is no need in such a synchronisation since HelpDesk adds contacts automatically when creating tickets on the basis of received E-mail messages or through a web widget. However, importing or updating contacts may be useful in cases when communication with customers occurs personally, by phone, etc. and in any case not via HelpDesk. Automation of contacts processing can lighten the work of the support staff.

Import Microsoft 365 Users into HelpDesk Contacts List

First, sign in to a Power Automate (Microsoft Flow) site and go to the list of flows.

List of flows

Then create a new blank flow, name it and find a recurrence trigger. It will allow you to start the flow by schedule. You may choose another trigger or replace the one later according to your needs.

Create new scheduled flow

Configure the trigger as you wish. The one on the screenshot below will start the flow every day at 10:15 (UTC) starting on 17 October 2019.

Create new scheduled flow

Add a new step (action).

Create new scheduled flow

Find “Microsoft 365 Users” connector and choose it.

Create new scheduled flow

Then select “Search for users” action.

Create new scheduled flow

If you leave the “Search term” field empty, the action will return all users without filtering. The “Top” field specifies how many first found users will be returned. By default, it is assigned to 0—it means the action will return first 100 users. To get more of them, specify a custom value in the field but it can’t be more than 999 due to Microsoft restrictions.

Note

If your organisation has more than 999 users, you need to modify the flow to get them piecemeal (e.g. by departments).

Create new scheduled flow

Further, find a HelpDesk connector.

Create new scheduled flow

And then select a “Create a contact” action.

Create new scheduled flow

Pass to the action dynamic data (output of the previous one), i.e. full name of a user and his/her E-mail. Set “Update if exists” property to “Yes” so the action could update a contact if it already exists instead of creating a duplicate. Note that the flow put the action in an “Apply to each” control so it will be repeated for each user found on the previous step.

Create new scheduled flow

Now save the flow and that is all. You can test it at once to ensure that the one works properly and not to wait the scheduled start.

Create new scheduled flow

After you click “Test,” choose the option according to which you will perform the trigger action and hit on a “Save & Test” button.

Create new scheduled flow

Run the flow.

Create new scheduled flow

And check its results.

Create new scheduled flow

As a result, the process of importing new users to teh list of contacts in HelpDesk is automated.

Synchronisation of HelpDesk Contacts with Microsoft 365 Users Profiles

When the task is not to add new contacts but keep the existing ones up to date, you can modify the flow to the following configuration.

If you want to check updates about user’s status once in a day, use the same recurrence trigger.

Create new scheduled flow

Next, add an action for SharePoint. It will get items from from the Contacts list of the SharePoint site on which HelpDesk is installed. Once you have selected SharePoint, you will need to log in. In advanced options you can filter query by role which equals to Member or Agent.

Get items

After that, you need to configure “Apply to each” loop which makes possible to control the list that you repeat over.

Loop action

Then add a “Get user profile” action for Microsoft 365.

Get user profiles

As next step, add a new action which will update fields in Contacts list in SharePoint if there were some changes in user profiles in Microsoft 365. Note that “Is enabled” field was created manually. You can find information how to create a new column here.

Update items

Don’t forget to save the new flow.