The people column represents a person(s) who is assigned items. Our API supports this column, so you can read and update the people column via the API.

Reading the people column

You can return the data in a people column in two different formats. The text field will return the data as a simple string, and the value field will return the data as a JSON string.

{
  "text": "Sales Team",
  "value": "{\"changed_at\":\"2022-07-21T12:00:00.000Z\",\"personsAndTeams\":[{\"id\":665845,\"kind\":\"team\"}]}"
}

Updating the people column

You can update a people column with both a simple string or a JSON string.

Simple strings

To update a people column, send a string of people you want to add to the column separated by a comma (","). Each number in the string should represent the ID of the person to be added.

For example: "4616627, 4616435, 4616912"

JSON

To update a people column, send an array with the people or teams you want to add to the column. Each item in the array should include an int representing the ID of the person/team, and a string signifying whether the item is a person or a team.

For example: "{\"personsAndTeams\":[{\"id\":4616627,\"kind\":\"person\"},{\"id\":4616666,\"kind\":\"person\"},{\"id\":51166,\"kind\":\"team\"}]}"

mutation {
  change_simple_column_value(item_id:123456789, board_id:987654321, column_id:"person", value:"[email protected]") {
    id
  }
}
mutation {
  change_multiple_column_values(item_id:123456789, board_id:987654321, column_values: "{\"people_2\" : {\"personsAndTeams\":[{\"id\":4616627,\"kind\":\"person\"},{\"id\":4616666,\"kind\":\"person\"},{\"id\":51166,\"kind\":\"team\"}]}}") {
    id
  }
}
fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    query : "mutation ($myBoardId:Int!, $myItemId:Int!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id }}",
    variables : JSON.stringify({
      myBoardId: YOUR_BOARD_ID,
      myItemId: YOUR_ITEM_ID,
      myColumnValues:"{\"people_2\": {\"personAndTeams\": [{\"id\": 4616627, \"kind\": \"person\"}, {\"id\": 4616666, \"kind\": \"person\"}, {\"id\": 51166, \"kind\": \"team\"}]}}"
    })
  })
})

You can find the Postman request to change the people column here.

Clearing the people column

You can clear the people column using a change_multiple_column_values mutation.

mutation {
    change_multiple_column_values(item_id: 123456789, board_id: 987654321, column_values: "{\"person\" : {\"personsAndTeams\":[]}}") {
        id
    }
}

You can also find the Postman request to clear the people column here.

πŸ“˜

Have questions?

Join our developer community! You can share your questions and learn from fellow users and monday.com product experts.

Don’t forget to search before opening a new topic!