Skip to main content

How to Add a Person Column to a SharePoint List with the REST API in Power Automate

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A person column holds people from your organization, picked by name or email address. A flow adds one with the REST API's createfieldasxml. Type='User' makes a column for one person. Type='UserMulti' with Mult='TRUE' makes one for several people.

Syntax​

The request goes through Send an HTTP request to SharePoint (How to Use Send an HTTP Request to SharePoint):

FieldValue
MethodPOST
Uri_api/web/lists/getbytitle('<list name>')/fields/createfieldasxml
HeadersAccept: application/json;odata=nometadata
Content-Type: application/json;odata=verbose
Body: general form
{
"parameters": {
"__metadata": { "type": "SP.XmlSchemaFieldCreationInformation" },
"SchemaXml": "<the column's Field element>",
"Options": 25
}
}

Options 25 keeps your internal name and adds the column to the forms and the default view. How to Add a Column to a SharePoint List with CreateFieldAsXml explains the number and the rest of the body.

The column itself is one Field element:

Person column: general form
<Field Type='<User or UserMulti>' Name='<internal name>' StaticName='<internal name>' DisplayName='<display name>' Description='<description>' Mult='TRUE' UserSelectionMode='<who can be picked>' Required='TRUE' />

From Microsoft's Field element reference:

  • Type: User for one person. UserMulti for several; the reference calls it a User field that can contain more than one value.
  • Name and StaticName: the internal name, which never changes. Flows and apps use it. Keep it without spaces.
  • DisplayName: the name people see above the column.
  • Description (optional): the hint under the column in the item form.
  • Mult='TRUE': only with UserMulti. The reference describes Mult only as a scale factor for numbers, but a person column created in the browser with Allow multiple selections has Type='UserMulti' and Mult='TRUE' in its schema, and the example below uses both.
  • UserSelectionMode: who can be picked. The reference gives 0, only the names of individuals, and 1, the names of both individuals and groups. The names from Microsoft's FieldUserSelectionMode list work too: PeopleOnly is 0 and PeopleAndGroups is 1.
  • Required='TRUE' (optional): the column must have a value.

The XML uses single quotes because it sits inside a JSON string, which uses double quotes.

The Example​

A blank list called Projects gets two person columns:

ColumnHoldsWho can be picked
ProjectLeadOne personPeople only
TeamMembersSeveral peoplePeople and groups

The flow has the trigger Manually trigger a flow and two Send an HTTP request to SharePoint actions, Add ProjectLead and Add TeamMembers.

Prerequisites​

  • Permission to change the list, such as Edit or Full Control on the site, for the account the flow's SharePoint connection uses.

Step 1: Add a Column for One Person​

Add Send an HTTP request to SharePoint and rename it Add ProjectLead:

FieldValue
Site AddressYour site
MethodPOST
Uri_api/web/lists/getbytitle('Projects')/fields/createfieldasxml
HeadersAccept: application/json;odata=nometadata
Content-Type: application/json;odata=verbose

The headers are under Advanced parameters. The body:

Add ProjectLead → Body
{
"parameters": {
"__metadata": { "type": "SP.XmlSchemaFieldCreationInformation" },
"SchemaXml": "<Field Type='User' Name='ProjectLead' StaticName='ProjectLead' DisplayName='ProjectLead' Description='The person who leads the project.' UserSelectionMode='PeopleOnly' />",
"Options": 25
}
}

Step 2: Add a Column for Several People​

Copy the action (How to Copy and Paste an Action in Power Automate) or add a new one, rename it Add TeamMembers, and keep the same site, method, Uri and headers. In the body, the type becomes UserMulti, Mult='TRUE' allows several people, and PeopleAndGroups allows groups as well:

Add TeamMembers → Body
{
"parameters": {
"__metadata": { "type": "SP.XmlSchemaFieldCreationInformation" },
"SchemaXml": "<Field Type='UserMulti' Name='TeamMembers' StaticName='TeamMembers' DisplayName='TeamMembers' Description='Everyone who works on the project.' Mult='TRUE' UserSelectionMode='PeopleAndGroups' />",
"Options": 25
}
}

The Add TeamMembers action with Method POST, the Uri _api/web/lists/getbytitle('Projects')/fields/createfieldasxml, the Accept and Content-Type headers, and the Body with SP.XmlSchemaFieldCreationInformation, a SchemaXml of Type UserMulti named TeamMembers with Mult TRUE and UserSelectionMode PeopleAndGroups, and Options 25

Step 3: Run the Flow​

Save the flow and test it manually (How to Test a Cloud Flow Manually in Power Automate). Both actions succeeded.

The Result​

The Projects list's New item form has both columns, each with a people picker and its description:

The New item form of the Projects list with Title, then ProjectLead and TeamMembers, each with an Enter a name or email address box and its description, The person who leads the project. and Everyone who works on the project.

The two boxes look the same; the difference is in the columns. Read back through the REST API, ProjectLead is a User column that doesn't allow multiple values, with selection mode 0. TeamMembers is a UserMulti column that allows multiple values, with selection mode 1. How to See a SharePoint Column's Internal Name and SchemaXml in the Browser shows how to read a column like that.

Common Mistakes​

MistakeWhat happensDo this instead
Type='User' for a column that needs several peopleThe column holds one personUse UserMulti with Mult='TRUE'
Double quotes inside the XMLThe JSON body breaksUse single quotes in the XML
An apostrophe in the descriptionThe attribute ends earlyWrite &apos;
Running the flow again unchangedIt tries to add the column a second timeCheck that the column is missing first

Troubleshooting​

SymptomLikely causeFix
Status 403The connection's account can't change the listGive it Edit or Full Control
Status 404No list with that title on the siteCheck the title in getbytitle('…')
Groups can't be pickedUserSelectionMode is PeopleOnly or 0Use PeopleAndGroups or 1

FAQ​

Can I limit the picker to one SharePoint group?​

The Field element has UserSelectionScope for that. The reference says that above 0 it restricts the picker to members of the SharePoint group whose ID equals the value. The example leaves it out, which means no restriction.

How do I fill a person column from a flow?​

With Create item or Update item, which show a field for it (How to Create an Item in a SharePoint List in Power Automate).

Does this need a premium licence?​

No. Send an HTTP request to SharePoint is part of the standard SharePoint connector.

Conclusion​

POST a Field element to createfieldasxml: Type='User' for one person, or Type='UserMulti' with Mult='TRUE' for several, and UserSelectionMode PeopleOnly or PeopleAndGroups for who can be picked. With Options 25, the column appears in the item form with its description.

Additional Resources​