cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Flownaut
Frequent Visitor

Push Office 365 users to Outlook Adress Book

Hi All,

 

First post, so I hope I get as clear and "compliant" as possible.

I want to build a flow or app that would search for Office 365 Users and push filtered relevant entries (users with a Name, Phone, Activated Account) to our users contacts folder. That way those contacts would sync to phone and when someone arrives to the company I'd know who is calling me. (And I'm very surprised nobody had the same idea :))

 

I used a template that push a Sharepoint list to User Contacts to get going, but I'm now struggling with the contact check before creating missing contacts.

 

flow.jpg

Here is what my last test results:

 

flowerror.jpg

I'd love to solve this but if you have hints or a different Flow that would allow me to get updated contact folder I'm open to it. (the searchuser query displays a max of 999 results and that's quite a small amount of results, I might need to create Service Account to get the results directly from Azure AD.

 

Other thing, I choose to use a button so that this flow uses current user who triggers the flow gets contacts in his own folder, not mine 😞 but does that mean I cannot trigger daily for example.

 

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Flownaut
Frequent Visitor

Re: Push Office 365 users to Outlook Adress Book

I was able to figure out a solution, as there is a way to get contact folders filter out the contact folder name and get its specific ID as it is different for each user. So my flow does the following:

 

- Get the list of users contact folder

- Select the folder named "Contacts" as its the defaut everyone has in its mailbox

- Get the ID from the folder to populate the folder ID asked when doing the get-contacts, create contacts and update contacts

- Get the Azure AD group members to populate its entries within Outlook contact folder

- Lookup in the user contact folder for a Display Name matching each group member

- If the contact from group membership exist, it updates the latter, else it creates a new contact

 

With that I was able to share a button with some coworkers allowing them to add the company selected employee to their contacts with the click of a button (according to the fact they sync contacts with activesync).

 

I have a couple more things annoying me so I hope some will have hints to achieve the missing elements:

 

- Check for contacts created with my Flow (I can populate a field meaning my contact was created with my flow) if they are still member of the Azure AD group else it means they could have left the company and so the contact needs to be deleted

- Is there a way to bypass the limits of the get-groupmember (100 users only) - Is setting top at 999 the only solution?

 

And so that anyone can reuse this, here is the flow (I could share it as a template maybe if anyone is interested...)

 

flow v2.jpgGet Contacts Foldersflow v2-1.jpgCheck if contacts from groups existsflow v2-2.jpgCreates or Update contact

Any improvements are welcome - for example to add some recurrence to this process, but is that even possible with a button as launcher?

View solution in original post

3 REPLIES 3
Community Support
Community Support

Re: Push Office 365 users to Outlook Adress Book

Hi @Flownaut ,

 

It seems that the Flow implementation failed because of an issue with the action in If yes branch. Please check the details of action error and make adjustments to the action configuration based on the error.

Try clicking Settings to increase the degree of parallelism of Apply to each to see if it meets expectations.

56.PNG57.PNG

In addition to the trigger, you could use Recurrence, which automatically triggers Flow according to the set period.

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Flownaut
Frequent Visitor

Re: Push Office 365 users to Outlook Adress Book

Hi Barry, 

 

Thank you for your reply. My issue was not the degree of parallelism, even though I didn't know about it.

I rebuilt my flow to get contacts from an AzureAD group membership and push them to my contacts and that's quite a simpler method. The aim is to provide company users a way of getting the company address book in their contacts with the simple click of a button.

 

If I run the flow with my credentials embedded it works great, but if I share the flow button, even specifying user must provide his credentials (as it's needed input to connect to his mailbox to populate his contacts) - The flow fails because of the contact folder which seems to be different for each user can you confirm that?

 

Here is the execution error I get when some other user clicks the button:

 

{
"status": 404,
"message": "The specified object was not found in the store., The process failed to get the correct properties.\r\nclientRequestId: b44803af-0bc8-47a2-b69a-a01a3169aa99\r\nserviceRequestId: 49455a11-3508-401d-aa56-192c0d8a2b0c",
"source": "office365-ne.azconn-ne.p.azurewebsites.net"
}
 
As if it was looking in my contact folder id. Can you confirm this is the problem? Maybe you can provide some hint...
 
Thanks a lot for the help.
Flownaut
Frequent Visitor

Re: Push Office 365 users to Outlook Adress Book

I was able to figure out a solution, as there is a way to get contact folders filter out the contact folder name and get its specific ID as it is different for each user. So my flow does the following:

 

- Get the list of users contact folder

- Select the folder named "Contacts" as its the defaut everyone has in its mailbox

- Get the ID from the folder to populate the folder ID asked when doing the get-contacts, create contacts and update contacts

- Get the Azure AD group members to populate its entries within Outlook contact folder

- Lookup in the user contact folder for a Display Name matching each group member

- If the contact from group membership exist, it updates the latter, else it creates a new contact

 

With that I was able to share a button with some coworkers allowing them to add the company selected employee to their contacts with the click of a button (according to the fact they sync contacts with activesync).

 

I have a couple more things annoying me so I hope some will have hints to achieve the missing elements:

 

- Check for contacts created with my Flow (I can populate a field meaning my contact was created with my flow) if they are still member of the Azure AD group else it means they could have left the company and so the contact needs to be deleted

- Is there a way to bypass the limits of the get-groupmember (100 users only) - Is setting top at 999 the only solution?

 

And so that anyone can reuse this, here is the flow (I could share it as a template maybe if anyone is interested...)

 

flow v2.jpgGet Contacts Foldersflow v2-1.jpgCheck if contacts from groups existsflow v2-2.jpgCreates or Update contact

Any improvements are welcome - for example to add some recurrence to this process, but is that even possible with a button as launcher?

View solution in original post

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,880)