We will learn to force synchronize the Office 365 users in Power Apps using Power Automate. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field of Power Platform.
What is force user synchronization and why do we need it?
Whenever we add a user in Office 365 / Azure AAD, the user gets synced into the respective Power Apps. But this process of syncing is not real-time in nature and takes a considerable amount of time for reflecting an user in Power Apps.
Therefore, we can forcefully synchronize the users from Office 365 into the Model-Driven App using the below given solution.
Using Power Automate for syncing users into Power Apps
We will use the action “Force Sync User” present in the out of the box connector “Power Platform for Admins” as shown below.
This action is been used to sync an user into the CRM / Model-Driven App. The “Force Sync User” requires the below given input parameters.
|Environment||environment||True||string||Name of the Environment.|
|ObjectId||ObjectId||True||string||User object Id.|
|API Version||api-version||False||string||The date value of the API.|
Example of bulk syncing users in Power Automate
The “Force Sync User” requires an Object ID or an User ID for syncing the user into Power App. Since we want to implement the bulk user synchronization functionality, we will first retrieve all the Office 365 users from the tenant and then forcefully sync each user with updated details into the Model-Driven App.
Below is the design of the Power Automate flow for bulk syncing users in Dynamics 365 CRM.
Testing the implementation in Dynamics 365 CRM / Model-Driven App
Once the Power Automate flow is ready, the users should get forcefully synced from Office 365 to the Power App as shown below.
Thus, we learned to force sync the users from Office 365 / Azure Active Directory into the Power Apps.