TableCollection: add

Important: APIs under the /beta version in Microsoft Graph are in preview and are subject to change. Use of these APIs in production applications is not supported.

Create a new table. The range source address determines the worksheet under which the table will be added. If the table cannot be added (e.g., because the address is invalid, or the table would overlap with another table), an error will be thrown.


The following scopes are required to execute this API:

* Files.ReadWrite

HTTP request

POST /workbook/tables/add
POST /workbook/worksheets/{id|name}/tables/add

Request headers

Name Description
Authorization Bearer {token}. Required.

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
address string Address or name of the range object representing the data source. If the address does not contain a sheet name, the currently-active sheet is used.
hasHeaders boolean Boolean value that indicates whether the data being imported has column labels. If the source does not contain headers (i.e,. when this property set to false), Excel will automatically generate header shifting the data down by one row.


If successful, this method returns 200, OK response code and Table object in the response body.


Here is an example of how to call this API.


Here is an example of the request.

Content-type: application/json
Content-length: 54

  "address": "Sheet1!A1:D5",
  "hasHeaders": true

Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 109

  "id": "99",
  "name": "name-value",
  "showHeaders": true,
  "showTotals": true,
  "style": "style-value"