0
votes

I need to rename the default "Content Type" column in sharepoint online document library that has several content types. Is there a way to do it using CSOM or any other way?

Thank you in advance.

1

1 Answers

1
votes

Rename default Content Type field name like this:

            List targetList = ctx.Web.Lists.GetByTitle("Documents");
            FieldCollection fields = targetList.Fields;
            ctx.Load(fields);
            ctx.ExecuteQuery();
            Field ctfield = fields.GetByInternalNameOrTitle("ContentType");
            ctx.Load(ctfield);
            ctx.ExecuteQuery();
            ctfield.Title = "CustomContentType";
            ctfield.Update();
            ctx.ExecuteQuery();

enter image description here

SharePoint Online: Rename a Column in List using PowerShell