I’ve demoed this Flow during my session ‘Automate your Dynamics 365 admin tasks with Flow!’ at Dynamics 365 Saturday Belgium in Brussels last Saturday.

This Flow will set the Site field for Users based on the City field.

Here is the overview of the Flow:

First I get the list of Site records that is stripped down to an array with only the Name and SiteId in the next action step.

Then I get the list of active Users and for each User record I check whether the City field is not empty.

Next I filter the Select Sites array on the Name equal to the City. Then I set the String variable to the SiteId from the filtered result. If a SiteId is available then it will go through the Succeeded scope, but if no SiteId is found then the action will fail and the flow will continue in the Failed scope.

In the Succeeded scope, the selected SiteId is compared with the Site value of the User record to check if they are equal or not. If not, the User record will be updated with the SiteId.


In the Failed scope, the missing Site is created and its SiteId is used to update the User record.


That’s it. Let the Flow run and the Site field will be set for the active Users, based on their City field.

Here is the download link for the flow: D365Get&SetSiteofUsers

The post Get & Set Site of Users based on City field with the help of Flow appeared first on There's Something About Dynamics 365.