web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Add a taxonomy field (...
Power Automate
Unanswered

Add a taxonomy field (managed metadata) site column to a library using rest api

(0) ShareShare
ReportReport
Posted on by 85

I have site columns that are managed metadata type that need to be added to a library after it is created using Power Automate action HTTP call to SharePoint.  Is there a FieldTypeKind for a taxonomy field?  I have the xml schema for the site column. I have scoured Google and this community to find a solution but I am not seeing a solution or answer to a question from a few years ago.  The following is what I have  but I am receiving the error "A node of type 'PrimitiveValue' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was expected."

 

 

 

Site Address: <My tenant>/sites/<my site>
Method: POST
Uri: _api/web/lists/getByTitle('@{triggerOutputs()?['body/ProjectName/Value']})/fields

Headers: {
 "Accept": "application/json;odata=verbose",
 "Content-Type": "application/json;odata=verbose"
}

Body: "parameters":{
"__metadata":{
"type": "SP.Field"
},
"FieldTypeKind": 15, "Title": "RetentionStatus", "SchemaXml": "<Field Type="TaxonomyField" DisplayName="RetentionStatus" Description="" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" Group="Retention Columns" StaticName="RetentionStatus" Name="RetentionStatus"></Field>
}

 

 

 Any assistance will be much appreciated.

 

Thank you!

Categories:
I have the same question (0)
  • skarthanal25 Profile Picture
    87 on at

    I was trying to accomplish the very same.  Unfortunately, it seems that the there is no field type kind for a managed metadata term.  In fact, I have researched and found that it is not supported via the REST calls.  This will have to be done in PowerShell or JSOM/CSOM.

  • IntraAdmin Profile Picture
    85 on at

    Thank you!

  • ArneRavndal Profile Picture
    2 on at

    Hi 🙂 

    I see this is half a year old, but I am also looking into this.

     

    I have found that I can add the managed metadata field using power automate just as you tried. 

     

    I found that using the GetByTitle('{title}')/Fields/createFieldAsXML endpoint 

    works fine. I am adding several fields at once, from an array of xmlschemas like this: 

    {
    "parameters": {
    "__metadata": { "type": "SP.XmlSchemaFieldCreationInformation" },
    "SchemaXml": " @replace(item(), '"','\"}'

    " }
    }

     

    After this runs I have access to adding tags from the termstore to the items in the list 🙂 

  • NotFlowing Profile Picture
    22 on at

    @ArneRavndalwould you mind showing the xml schema you're using?
    I'm trying to add a managed metadata field from my existing site columns to a sharepoint library. It does show the column name, but not the tags inherited from the taxonomy field

  • Expiscornovus Profile Picture
    33,871 Most Valuable Professional on at
     
    Sorry to bump this one, but I was searching for the same answer (the required SchemaXml payload to create this type of field).
     
    In my search I came across an approach on a blog from Beau Cameron:
     
    In that blog he has shared the SchemaXml values for both the (related hidden) Note field and the Taxonomy field itself.
     
    I have adapted that to a Power Automate cloud flow setup with two HTTP requests:
     
    Note Field payload (make sure you update the FieldName & Guid)
    {"parameters":{"__metadata":{"type":"SP.XmlSchemaFieldCreationInformation"},"SchemaXml":"<Field ID='{@{variables('Guid')}}' SourceID='http://schemas.microsoft.com/sharepoint/v3' Type='Note' Name='@{variables('FieldName')}TaxHTField' StaticName='@{variables('FieldName')}TaxHTField' DisplayName='@{variables('FieldName')}TaxHTField' Group='Test group' ShowInViewForms='FALSE' Required='FALSE' Hidden='TRUE' CanToggleHidden='TRUE' />","Options":12}}
     
    Taxonomy Field payload (make sure you update the FieldName, Guid, TermstoreId and TermSetId)
    {"parameters":{"__metadata":{"type":"SP.XmlSchemaFieldCreationInformation"},"SchemaXml":"<Field Type='TaxonomyFieldType' Name='@{variables('FieldName')}' SourceID='http://schemas.microsoft.com/sharepoint/v3' StaticName='@{variables('FieldName')}' DisplayName='@{variables('FieldName')}' Group='Test group' ShowField='Term1033' Required='FALSE' EnforceUniqueValues='FALSE' Mult='FALSE'> <Default></Default> <Customization> <ArrayOfProperty> <Property> <Name>SspId</Name> <Value xmlns:q1='http://www.w3.org/2001/XMLSchema' p4:type='q1:string' xmlns:p4='http://www.w3.org/2001/XMLSchema-instance'>@{variables('TermStoreId')}</Value> </Property> <Property> <Name>GroupId</Name> </Property> <Property> <Name>TermSetId</Name> <Value xmlns:q2='http://www.w3.org/2001/XMLSchema' p4:type='q2:string' xmlns:p4='http://www.w3.org/2001/XMLSchema-instance'>@{variables('TermSetId')}</Value> </Property> <Property> <Name>TextField</Name> <Value xmlns:q6='http://www.w3.org/2001/XMLSchema' p4:type='q6:string' xmlns:p4='http://www.w3.org/2001/XMLSchema-instance'>{@{variables('Guid')}}</Value> </Property> <Property> <Name>AnchorId</Name> <Value xmlns:q3='http://www.w3.org/2001/XMLSchema' p4:type='q3:string' xmlns:p4='http://www.w3.org/2001/XMLSchema-instance'>00000000-0000-0000-0000-000000000000</Value> </Property> <Property> <Name>IsPathRendered</Name> <Value xmlns:q7='http://www.w3.org/2001/XMLSchema' p4:type='q7:boolean' xmlns:p4='http://www.w3.org/2001/XMLSchema-instance'>false</Value> </Property> <Property> <Name>IsKeyword</Name> <Value xmlns:q8='http://www.w3.org/2001/XMLSchema' p4:type='q8:boolean' xmlns:p4='http://www.w3.org/2001/XMLSchema-instance'>false</Value> </Property> <Property> <Name>Open</Name> <Value xmlns:q5='http://www.w3.org/2001/XMLSchema' p4:type='q5:boolean' xmlns:p4='http://www.w3.org/2001/XMLSchema-instance'>false</Value> </Property> </ArrayOfProperty> </Customization> </Field>","Options":12}}
     
     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, Bluesky profile or Youtube Channel
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard