Create new column from template

Copper Contributor

Hello world,

I have a big sharepoint list to create in the context of an audit app on powerApps.

I have about 60 columns with different names but the same choice options.

Is it possible to create a template to speed up the creation process? Site columns don't seem to do the job.

Thanks a lot!

1 Reply

The best way is to use PowerShell
Here is the sample works for five columns with same choice. If you want it for more replace the value 5 in the for loop

############################Description########################
#Create new column with same choice
#############################################################


# Replace the values below with your own values
$siteUrl = "https://contoso.sharepoint.com/sites/SPDev"
$listName = "Custom List"
$choices = "Not Started","Pending","Completed"

# Connect to SharePoint Online
Connect-PnPOnline -Url $siteUrl -UseWebLogin

# Add five "Status" columns to the list with the specified values
for ($i=1; $i -le 5; $i++) {
$columnName = "Status$i"
Add-PnPField -List $listName -DisplayName $columnName -InternalName $columnName -Type Choice -Group "Demo Group" -AddToDefaultView -Choices $choices
}