Update table view
Request
curl -vvv -X PATCH "$API_HOST/open/api/v1/tablenodes/$table_id/views/$view_id/" -H "Authorization: $access-token" -d '$request_body'
Request example
{
"name":"newViewName",
"filterCondition":"or",
"filters": [{"columnID":"645d87151694c57ce7af57c6","relation": "lessThan","value":30}],
"groups": [{"columnID":"645d87151694c57ce7af57c6","order":"desc" }],
"orders": [{"columnID":"645d87151694c57ce7af57c6","order":"desc" }],
"frozenColumnCount": 4,
"rowHeight": "low",
"desc": "description",
"backgroundColor": "#228675"
}
Parameter description
Name | Type | Description | Required |
---|---|---|---|
name | string | view name | |
filterCondition | int64 | filter condition: and, or | |
filters | array | filter array | |
groups | array | group list | |
orders | array | order list | |
frozenColumnCount | int64 | frozen columns number | |
rowHeight | string | row height: low, middle,high | |
desc | string | description | |
backgroundColor | string | backgound color |
Python example
def update_table_view(access_token, table_id, view_id, name):
url = '%s/open/api/v1/tablenodes/%d/views/%s/' % (API_HOST, table_id,view_id)
headers = {'Authorization': access_token}
data = {
"name": name,
}
req = requests.patch(url, headers=headers, json=data)
return req.json()
Response
Name | Type | Description |
---|---|---|
detail | object | updated view info |
∟ projectID | int64 | project id |
∟ tableNodeID | int64 | table id |
∟ updatedFields | object | updated filed info |
∟ viewID | int64 | view id |
Response example
{
"code": 0,
"detail": {
"projectID": 16,
"tableNodeID": 73,
"updatedFields": {
"filterCondition": "and",
"name": "view312"
},
"viewID": "645f37904444eb50dc9d63a8"
},
"extra": null,
"message": "OK",
"requestID": null
}