TaxonomyFieldControl.GetTaxonomyValue(String) TaxonomyFieldControl.GetTaxonomyValue(String) TaxonomyFieldControl.GetTaxonomyValue(String) Method

Definition

Converts a string to a TaxonomyFieldValue object.

public:
 static Microsoft::SharePoint::Taxonomy::TaxonomyFieldValue ^ GetTaxonomyValue(System::String ^ text);
public static Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue GetTaxonomyValue (string text);
Public Shared Function GetTaxonomyValue (text As String) As TaxonomyFieldValue
Parameters
text
String String String

String to be converted into a TaxonomyFieldValue object

Returns

The TaxonomyFieldValue object that is created from the string text

Exceptions

If a null or empty string is passed in, an argument exception is thrown.

Remarks

The string that is passed in must be formatted with a label and its GUID must be delimited with a | character. You can repeat the format more than one time and delimit it with a ; character,This method can also be used with a full GUID path. For example, if you have the Term object named X with the GUID 12345678-1234-1234-1234-123456789012, and you have the parent Term named Y at the root of the TermSet object with the GUID 87654321-4321-4321-4321-210987654321, you can use either of the following values: X|12345678-1234-1234-1234-123456789012, or X|87654321-4321-4321-4321-210987654321|123456789-1234-1234-1234-123456789012.

Applies to