Populating a SharePoint List with data is required for different purposes quite often. In this article I am going to demonstrate how to populate Contacts list with a fake data using CSOM.
Provision column to a List via SharePoint CSOM
We will utilize Contacts List for demonstration purposes. But before we proceed, let’s add a Geolocation field to a list.
Since the Geolocation column is not available by default in SharePoint lists, it’s common practice to provision this field to a list programmatically. The code below demonstrates how to add the Geolocation field by using the SharePoint client object model:
Generate list data
After running the script the Contacts list will be populated with a fake data as demonstrated below.
Contacts default view
Contacts map view