Forum Discussion
Creating a sharepoint list programatically
Hi,
I have an excel file with 100~ columns which was exported from another SharePoint list (that I don't have access to). I would like to create a list on my SharePoint site from this file but the simple 'create list from xlsx' doesn't allow me to use many of the column types that I need (lookup, choice etc.).
Initially I tried using the PowerShell connector for SharePoint but my org doesn't have permissions enabled for it. So I would I like to explore alternative solutions.
The one I have in mind is to acquire an .stp template from somewhere (my org has also disabled built-in templates so I cant seem to download a copy) and modify its JSON definition to add columns with python. Another option is to modify the xml of a list and add the columns that way.
Any help would be appreciated.
- ExpiscornovusIron Contributor
APinglay if PowerShell is not possible I would suggest to have a look at something like Power Automate cloud or desktop flows. Via these products you should also be able to automate some steps.
You could for example read the table with list rows in table action and use Send an HTTP request to SharePoint action to create your fields in a cloud flow.
Desktop flows (RPA) also has a lot of Excel actions: https://learn.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/excel and also supports Python code, https://learn.microsoft.com/en-us/power-platform/release-plan/2024wave1/power-automate/use-python-v3-power-automate-desktop