Field name already exists
-
30-09-2020 - |
Question
All
I have backed up a sharepoint site and restored to another environment. I have a specific list which I want to update the default value of a hidden field in powershell
I found the field, set default value. But when I call field.Update() I see the error below.
I also see this error when I try to create and index on same list. I did quite a lot of search last 2 days, but no luck.
Do you guys have any idea?
Update : Exception calling "Update" with "1" argument(s): "Field name already e xists. The name used for this field is already used by another field in the list. Sel ect another name and try again." At line:1 char:14 + $field.Update <<<< ($true) + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
La solution
after more digging, what I found is that, I had 2 different column in that list which has same GUID.
there is a script on this link which helped me to found those fields. Then I removed them from my list. Luckily, those fields were not used, so all worked smoothly.
I hope it helps others