[X ] Bug
[X] Office 365 / SharePoint Online
I'm trying to set a column default value for a folder using DefaultColumnValue. I get no errors applying the template, but there is no column default value for the folder.
I've previously posted about this issue in PnP-Provisioning-Schema, but since I haven't got any replies to that post, I try to post here as well.
https://github.com/SharePoint/PnP-Provisioning-Schema/issues/344
Thank you. @schoier. I鈥檒l try to repro and report back with my findings.
I also had this issue. i ended up using CSOM
var metadataDefaults = new Microsoft.SharePoint.Client.DocumentManagement.MetadataDefaults(context, SPlist);
Microsoft.SharePoint.Client.Folder folder = listToOperate.RootFolder.EnsureFolder("Templates");
if(folder.Exists)
{
metadataDefaults.SetFieldDefault(folder, "xxx-fieldName", "xxx-defaultValue");
metadataDefaults.Update();
}
@wobba Maybe I'm stupid, but the DefaultColumnValues are never set because the corresponding extension method is never called internally. Especially not in the class responsible for creating and configuring lists from the provisioning profile
Search:
https://github.com/SharePoint/PnP-Sites-Core/search?utf8=%E2%9C%93&q=DefaultColumnValues&type=
@tmeckel Thanks for the input!
Can someone give an answer to when this will be implemented?
@wobba Any updates on the implementation?
@schoier haven't had time to look at this - but we do accept PR's if you have time :)
@schoier taking a look right now
@wobba I don't know if it's related, but you can take a look at Set-PnPDefaultColumnValues does not work with nordic letters in -Folder parameter #1706
Just to make sure we don't get the same problem with this part.
It's the same code basically :) Encoding is always an issue it seems.
I'll take a look at https://github.com/SharePoint/PnP-PowerShell/issues/1706 while fixing this one.
@schoier Default column value support has been added and will be included in next months release.
@wobba Great news - thank you!
Doesnt work for me, Im using version
I've got this going on in a list (which works fine creating the folder ) but it does not set the default column value
I have a column which comes through with the Content Type assocated with the list, Ive tried 'Engineering Category' and 'Engineering_x0020_Category' to no avail.
The only way I can get defaults to set on a folder is to go through the UI like so

Am I missing something? Or have I completely mis-understood what is meant by DefaultColumnValues ?
cheers
@nigel-dewar which version of PnP PowerShell are you using?
Goodmorning,
Can someone tell me if it's possible to use the element in a xml provisioning template?
Thx Martin
@offringam It should work. If not, please open a new issue and include a sample template and explanation of the type of column etc.