In this fast track post, I will show you how to create a List Choice XML type filed in a SharePoint Online list using Power Automate flow action.
To implement this demo we will use the “Send an HTTP request to SharePoint” action
Site Address:
https://{site}.sharepoint.com/sites/{SiteName} |
Method:
POST
Uri:
_api/web/Lists/getByTitle('{ListName}')/fields/CreateFieldAsXml
Headers :
{ "content-type": "application/json;odata=verbose;charset=utf-8", "Accept": "application/json;odata=verbose" }
Body :
{"parameters": {"__metadata": {"type":"SP.XmlSchemaFieldCreationInformation"},"SchemaXml":"<Field DisplayName='Choises-Field' FillInChoice='FALSE' IsModern='TRUE' Name='Choises-Field' Title='Choises-Field' Type='Choice'> <CHOICES><CHOICE>Choice 1</CHOICE><CHOICE>Choice 2</CHOICE> <CHOICE>Choice 3</CHOICE><CHOICE>Choice 4</CHOICE></CHOICES> </Field>","Options":12}}
The screenshot below depicts an example