Reputation: 13
I'm looking at a table (Table1
) inside an Excel book saved on my OneDrive for Business account. I then want to get the maximum value in the CREATEDDATE
column from this table.
I want to avoid pulling down the whole table with the API, so I'm trying to filter the results of my query to only the CREATEDDATE
column. However, the column results from the table are not being filtered to the one column and I'm not getting an error to help troubleshoot why. All I get is an HTTP 200
response and the full unfiltered table results.
Is it possible to filter the columns retrieved from the API by the column name? The documentation made me think so.
I've confirmed that /columns?$select=name
works correctly and returns just the name field, so I know that it recognizes this as an entity. $filter
and $orderby
do nothing when referencing any of the entities from the response (name
, id
, index
, values
). I know that I can limit columns by position, but I'd rather explicitly reference the column by name in case the order changes.
I'm using this query:
/v1.0/me/drive/items/{ID}/workbook/tables/Table1/columns?$filter=name eq 'CREATEDDATE'`
Upvotes: 1
Views: 1031
Reputation: 33094
You don't need to $filter
here, just pull it by the name directly. The prototypes from the Get TableColumn documentation are:
GET /workbook/tables/{id|name}/columns/{id|name}
GET /workbook/worksheets/{id|name}/tables/{id|name}/columns/{id|name}
So in your case, you should be able to simply call call:
/v1.0/me/drive/items/{ID}//workbook/tables/Table1/columns/CREATEDDATE
Upvotes: 1