Share via


TaxonomyFieldValue constructor (String)

Initializes a new instance of the TaxonomyFieldValue object that is based on the specified field value.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)

Syntax

'Declaration
Public Sub New ( _
    value As String _
)
'Usage
Dim value As String

Dim instance As New TaxonomyFieldValue(value)
public TaxonomyFieldValue(
    string value
)

Parameters

  • value
    Type: System.String

    A formatted string that contains the internal identifier, label, and path of the field

Remarks

The TaxonomyFieldValue object is not bound to a taxonomy field by this constructor so the TermGuid and the ValidatedString properties will throw ArgumentExceptions when called on a TaxonomyFieldValue object that is created with this constructor. To avoid the exception, values for those fields must be set explicitly or with the methods or properties on the object.

The string passed as the value parameter must be formatted either as:[ID;#LABEL] or [ID;#LABEL|PATH].[ID] is the internal identifier of the field value in the list.[LABEL] is the default label of the Term object that is referenced by the TaxonomyField object. [PATH] is a string of GUIDs delimited by a pipe (|) character and terminating in the GUID that identifies the Term: [ROOT_TERM_GUID|...|PARENT_TERM_GUID|TERM_GUID].

The delimiters in the value string representation are defined by the following properties:[;#] is returned by the Delimiter property, and**[|]** is returned by the TaxonomyGuidLabelDelimiter property.

See also

Reference

TaxonomyFieldValue class

TaxonomyFieldValue members

TaxonomyFieldValue overload

Microsoft.SharePoint.Taxonomy namespace

TaxonomyField

Microsoft.SharePoint.Taxonomy

Microsoft.SharePoint