Forum Discussion
How to generate a SharePoint List to pull users from Office 365?
We have created some great SharePoint lists for deployment purposes and the one SWEET function I would like to see is every time we generate a new SP list, it populates the Name field with users from Office 365 based on the location. This would allow us to get active user lists instead of manually adding them.
One workaround we know works now is to export the users from Office 365 into a csv file and then import them into the list. I would like this "process" to happen automatically when the list is created.
Any ideas?
11 Replies
- BarryGoblonIron ContributorI suggest automating the synchronization of user data between Office 365 and SharePoint lists, especially for deployment purposes, can significantly streamline operations. The manual process of exporting and importing users is like tending a garden by hand-effective but labor-intensive. A practical solution lies in leveraging Microsoft Power Automate to create an automated workflow that triggers with each new SharePoint list creation. This workflow would fetch user information from Azure Active Directory, focusing on location-based attributes to tailor the user list accordingly. With the right conditions and actions set up, the workflow can populate your SharePoint list with the relevant user data automatically upon creation.
This method not only saves time but also ensures that your SharePoint lists are always up-to-date with active user information based on location, eliminating the need for manual updates. It might require initial setup and tweaking, particularly to filter users by location, but once in place, it's like having an automated garden that seeds itself - effortless and efficient. Remember, access permissions for Azure AD and SharePoint are crucial here, along with a good grasp of Power Automate for setting up the flow correctly. This approach turns a tedious task into a seamless part of your system administration routine, letting you focus on more strategic projects. - TimLBSteel Contributor
Sounds like you're going to want to create an app for this. Use the MS Graph for the User Info - https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http
- dgillespie-adfCopper Contributor
TimLBthanks for the reply. Taking a few steps back, create an app? As in Power Apps? Our environment is completely O365.
- TimLBSteel Contributor
dgillespie-adf Yes, that would be one way. Initiate the creation of the process via a PowerApp - collect the data you need to create the list, then trigger a PowerAutomate workflow to create the list and populate the list with the data from the User Graph API. I think the connector to create the list and pull the user data to the list may be custom connectors and would require some premium licenses to get that accomplished.
So the other app route would be to deploy PnP kind of solution that someone would have to write code to make things happen. Unfortunately, I'm not very familiar with what it would take to do this.