Introduction:
Organizations use SharePoint Lists to efficiently manage structured data, but often, this data needs to be transferred to an SQL database for reporting, analytics, or further processing. Manually handling this process can be time-consuming and prone to errors. Automating it using Automation Anywhere ensures data consistency, eliminates manual effort, and improves efficiency.
In this blog, I will walk you through the steps to read rows from a SharePoint List and insert them into an SQL table using Automation Anywhere.
Prerequisites
Before we begin, ensure you have the following:
- Access to Automation Anywhere Control Room and Bot Creator
- A SharePoint Online List with the required data
- An SQL Database with an appropriate table structure
- ODBC or direct database connection to insert data into SQL
Step 1: Set Up API Access for SharePoint
To interact with SharePoint, you need to configure API access:
- Set up API permissions for your SharePoint site.
- Obtain the OAuth2 API keys and the subdomain for your organization.
- Example: If your SharePoint site is www.contessa.sharepoint.com, your subdomain is contessa.
Step 2: Connect to SharePoint
- Use OAuth2 authentication to connect to SharePoint.

Step 3: Retrieve SharePoint List Items
- Use the "Get List Item" action in Automation Anywhere.
- Provide the Group Name and List Name.
- Store the retrieved values in a List variable.

Step 4: Loop Through List Items
- Loop through each dictionary variable to extract individual values.

Step 5: Assign Values to Variables
- Assign required column values to respective variables for further processing.

Step 6: Insert Data into SQL Database
Now that we have extracted SharePoint data, we can:
- Use inline SQL queries to insert data directly.
- Write a Stored Procedure (SP) for insertion.
- Store the extracted data in any document (excel etc) for further processing.
Conclusion
By automating the extraction of SharePoint List data and inserting it into an SQL database using Automation Anywhere, organizations can streamline data processing and improve accuracy. This method ensures seamless data synchronization while reducing manual effort.
Happy coding...!
For any questions or further assistance, feel free to connect with me on https://www.linkedin.com/in/madhukumarts/