How to set the default value for a SharePoint page layout field when using Design Manager snippets?

%3CLINGO-SUB%20id%3D%22lingo-sub-222577%22%20slang%3D%22en-US%22%3EHow%20to%20set%20the%20default%20value%20for%20a%20SharePoint%20page%20layout%20field%20when%20using%20Design%20Manager%20snippets%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-222577%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20business%20requirement%20to%20set%20a%20default%20value%20for%20a%20field%20within%20a%20SharePoint%20page%20layout.%20When%20attempting%20to%20enter%20a%20value%20in%26nbsp%3BListItemFieldValue%20within%20the%20snippet%20customization%20I%20encounter%20the%20error%26nbsp%3B%3CEM%3ECannot%20create%20an%20object%20of%20type%20'System.Object'%20from%20its%20string%20representation%20'%23myValue%23'%20for%20the%20'ListItemFieldValue'%20property.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20using%20ItemFieldValue%2C%26nbsp%3BListItemFieldValue%2C%20and%20Value%20with%20the%20same%20results.%26nbsp%3B%20I%20came%20across%20an%20article%20that%20shows%20how%20to%20manually%20code%20in%20a%20value%20for%20a%20rich%20text%20field%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F173555%2Fpre-populate-html-content-in-the-page-content-field-of-custom-article-page-layou%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F173555%2Fpre-populate-html-content-in-the-page-content-field-of-custom-article-page-layou%3C%2FA%3E%2C%20but%20cannot%20find%20any%20similar%20information%20for%20other%20field%20types.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20specifically%20trying%20to%20set%20the%20default%20value%20for%20a%20managed%20metadata%20column.%20I%20am%20encountering%20the%20error%20for%20other%20field%20types%2C%20such%20as%20a%20number%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-222577%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

I have a business requirement to set a default value for a field within a SharePoint page layout. When attempting to enter a value in ListItemFieldValue within the snippet customization I encounter the error Cannot create an object of type 'System.Object' from its string representation '#myValue#' for the 'ListItemFieldValue' property.

 

I've tried using ItemFieldValue, ListItemFieldValue, and Value with the same results.  I came across an article that shows how to manually code in a value for a rich text field, https://sharepoint.stackexchange.com/questions/173555/pre-populate-html-content-in-the-page-content-..., but cannot find any similar information for other field types.

 

I am specifically trying to set the default value for a managed metadata column. I am encountering the error for other field types, such as a number column.

 

0 Replies