Making Content Authors’ Lives Easier A Sitecore Utility for Bulk Field Updates

In my last blog, I shared a tool that helps content authors read multiple field values in bulk. It brings all the data into one place using an Excel or CSV file. Now, I’ve extended that tool to allow updates as well. This new script uses the same file to update content in Sitecore. It also gives authors the option to publish the changes right away or just save them for later.
The goal is to make a simple and user-friendly tool that the marketing team can use without needing to open a PowerShell window.
Let’s walk through the steps:
1. File Upload Made Easy
Instead of asking content authors to upload the file to the Media Library and then reference it, we’ve added a file upload control. This lets them upload the CSV file directly from the previous report.
$dataFolder = [Sitecore.Configuration.Settings]::DataFolder
$tempFolder = $dataFolder + "\temp\upload"
$filePath = Receive-File -Path $tempFolder -overwrite
Write-Host $filePath
$allowedExtensions = @('.csv')
$extension = [System.IO.Path]::GetExtension($filePath)
if (($filePath -eq "cancel") -and ($allowedExtensions -notcontains $extension)) {
Write-Host "Invalid file format. Please upload a CSV file."
Exit
}
$resultSet = Import-Csv $filePath
$allowedExtensions = @("ID", "Name", "ItemPath", "TemplateName", "Field Name", "Field Value", "Updated Value")
$columnNames = Get-Member -InputObject $resultSet[0] | Where-Object { $_.MemberType -eq "NoteProperty" } | select-object Name
foreach ($column in $columnNames) {
if ($allowedExtensions -notcontains $column.Name) {
Write-Host "Invalid column name $($column). Make sure you upload a csv File generated by read script."
Exit
}
}

2. Simple Publishing Options
After uploading the file, the tool shows a clean interface where users can choose whether they want to publish the changes. If they do, they can also select the publishing target.
$publishOptions = [ordered]@{
"Edit Only" = "EO"
"Edit and Publish" = "EOP"
}
$databases = [Sitecore.Configuration.Factory]::GetDatabases()
$EditTargetsOpts = @{}
foreach ($db in $databases) {
if ($db.Name -ne "core") {
$EditTargetsOpts[$db.Name] = $db.Name
}
}

3. Updating the Items
This is where the script reads the file and updates the content in Sitecore. It may look simple, but the value lies in how everything is connected uploading the file, choosing whether to publish, and selecting the target all in one place.
$resultSet | ForEach-Object {
$scItem = Get-Item -Path "$($EditingTarget):" -ID $_.ID;
if (($scItem -ne $null)-and($_."updated Value" -ne "")) {
$scItem.Editing.BeginEdit()
$scItem.Fields[$_."Field Name"].Value = $_."Updated Value"
$scItem.Editing.EndEdit()
Write-Host "Item updated successfully"
if ($EditorEditandPublish -eq "EOP") {
<# Action to perform if the condition is true #>
$scItem | Publish-Item -PublishMode Smart -Target "web"
}
}
else {
Write-Host "Item not found"
}
}
This tool may not be complex in terms of code, but it brings together different parts of the process into a single, easy-to-use interface. It gives control to the content authors and helps them work more efficiently.
I hope this helps you in your future Sitecore projects. See you in the next post!