You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a need to update the formula for a calculated column that is associated with content types I am using in a library. The cmdlet works fine when the number of items in the list does not exceed 5000, but we have many libraries where it does exceed 5000 and so running the below (simplified code) results in:
Error:
Set-PnPField: The attempted operation is prohibited because it exceeds the list view threshold.
It seems that when you make an update to a calculated column like this SP triggers a recalculation on each item in the list.
I have tried various approaches for getting the update to process in 'batches' but cant seem to get any to work ... they all end up throwing the same error.
Anyone encounter a similar situation and or found a way to do this?
One recommendation I found was to update the column at the site level, but when I do that the formula update looks like this for some reason:
=IF(#NAME?<>"Yes","Archive",(IF(AND(#NAME?="Yes",#NAME?=FALSE),"Archiving in Progress","Archived")))
In addition, i found another issue a while back where site level updates for some formulas don't get propagated to the lists, which is why I am trying to do a direct update on the list.
Another recommendation was to use indexed columns, but it does not look like I can index a calculated column.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a need to update the formula for a calculated column that is associated with content types I am using in a library. The cmdlet works fine when the number of items in the list does not exceed 5000, but we have many libraries where it does exceed 5000 and so running the below (simplified code) results in:
$colName="Archive Status"
$ColFormula = '=IF([Archive File]<>"Yes","Archive",(IF(AND([Archive File]="Yes",[Archive Processed]=FALSE),"Archiving in Progress","Archived")))'
$ctxSp = Connect-PnPOnline -Url "https://mysticdev.sharepoint.com/sites/KI0001_DK_Rel1_Site_1" -ClientId $appId -Tenant $tenantId -Thumbprint $thumbPrint -ReturnConnection
Set-PnPField -List "KEEPit Files" -Identity $colName -Connection $ctxSp -Values @{Formula=$colFormula}
Error:
Set-PnPField: The attempted operation is prohibited because it exceeds the list view threshold.
It seems that when you make an update to a calculated column like this SP triggers a recalculation on each item in the list.
I have tried various approaches for getting the update to process in 'batches' but cant seem to get any to work ... they all end up throwing the same error.
Anyone encounter a similar situation and or found a way to do this?
One recommendation I found was to update the column at the site level, but when I do that the formula update looks like this for some reason:
=IF(#NAME?<>"Yes","Archive",(IF(AND(#NAME?="Yes",#NAME?=FALSE),"Archiving in Progress","Archived")))
In addition, i found another issue a while back where site level updates for some formulas don't get propagated to the lists, which is why I am trying to do a direct update on the list.
Another recommendation was to use indexed columns, but it does not look like I can index a calculated column.
Any ideas/help appreciated.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions