Adding Descriptions to Fields

%3CLINGO-SUB%20id%3D%22lingo-sub-31929%22%20slang%3D%22en-US%22%3EAdding%20Descriptions%20to%20Fields%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-31929%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20it%20possible%20to%20add%20a%20description%20to%20the%20field%20in%20a%26nbsp%3Bcustom%20list%26nbsp%3Busing%20Add-PnPField%3F%26nbsp%3B%20Or%20does%20anyone%20have%20a%26nbsp%3Bway%20of%20programmatically%20adding%20a%20description%20after%20the%20field%20has%20been%20created.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-31956%22%20slang%3D%22en-US%22%3ERE%3A%20Adding%20Descriptions%20to%20Fields%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-31956%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20works%3A%3C%2FP%3E%0A%3CP%3E%24field%20%3D%20Get-PnPField%20-List%20Risks%20-Identity%20Likelihood%3C%2FP%3E%0A%3CP%3E%24field.Description%3C%2FP%3E%0A%3CP%3E%24field.Description%3D%22This%20works%22%3C%2FP%3E%0A%3CP%3E%24field.Update()%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-31932%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20Descriptions%20to%20Fields%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-31932%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F17347%22%20target%3D%22_blank%22%3E%40Matt%20Munslow%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20description%20seems%20to%20be%20missing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMaybe%20a%20bit%20of%20a%20heavy%20way%20of%20doing%20this%20but%20you%20could%20use%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EGet-PnPProvisioningTemplate%20-Out%20test.xml%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20update%20the%20xml%20by%20editing%20it%20manually%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EApply-PnPProvisioningTemplate%20-Path%20test.xml%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI'm%20assuming%20that%20you%20prefer%20to%20stick%20to%20PowerShell.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Microsoft

Is it possible to add a description to the field in a custom list using Add-PnPField?  Or does anyone have a way of programmatically adding a description after the field has been created.

2 Replies
Highlighted

Hi  @Matt Munslow,

 

The description seems to be missing.

 

Maybe a bit of a heavy way of doing this but you could use

 

Get-PnPProvisioningTemplate -Out test.xml

 

Then update the xml by editing it manually

 

Apply-PnPProvisioningTemplate -Path test.xml

 

I'm assuming that you prefer to stick to PowerShell. 

 

Highlighted

This works:

$field = Get-PnPField -List Risks -Identity Likelihood

$field.Description

$field.Description="This works"

$field.Update()