
Announcements
Hi everyone,
I'm currently working on automating the creation of a Managed Metadata column in a SharePoint Online library using Power Automate. I’ve successfully used the "Send an HTTP request to SharePoint" action to:
CreateFieldAsXml endpoint./fields/getbyinternalnameortitle() endpoint.FormDigestValue using the _api/contextinfo endpoint for secure updates.I can successfully create the metadata field with the following schema:
FormDigestValue with _api/contextinfo.When I attempt to associate the field with an existing Term Set via the /update endpoint, I get a 502 Bad Gateway error.
Here’s the full URI I’m calling (dynamically composed):
_api/web/lists/getbytitle('Test')/fields('<FieldGUID>')/update
Headers:
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-RequestDigest": "<dynamic from contextinfo step>"
}
Body:
{
"__metadata": { "type": "SP.Taxonomy.TaxonomyField" },
"SspId": "2954755e-a0f9-4a35-a115-f7b718803e78",
"TermSetId": "9dc7c5f5-21f1-41fe-b213-bd1438d78c43",
"AnchorId": "00000000-0000-0000-0000-000000000000",
"AllowMultipleValues": false,
"Open": false
}
BadGateway
The parameter __metadata does not exist in method GetById.
clientRequestId: <GUID>
serviceRequestId: <GUID>
I’ve validated that:
X-RequestDigest is being passed dynamically and is valid/update endpoint is correct syntactically (per SharePoint REST documentation)"__metadata": { "type": "SP.Taxonomy.TaxonomyField" } to "SP.Field" also results in the same errorAny insight would be appreciated. I’m trying to keep this within a native Power Automate context if possible, but open to options.
Thanks in advance!
—Chris