Skip to main content

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

NameTypeDescriptionRequired
namestringview name
filterConditionint64filter condition: and, or
filtersarrayfilter array
groupsarraygroup list
ordersarrayorder list
frozenColumnCountint64frozen columns number
rowHeightstringrow height: low, middle,high
descstringdescription
backgroundColorstringbackgound 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

NameTypeDescription
detailobjectupdated view info
∟ projectIDint64project id
∟ tableNodeIDint64table id
∟ updatedFieldsobjectupdated filed info
∟ viewIDint64view id

Response example

{
"code": 0,
"detail": {
"projectID": 16,
"tableNodeID": 73,
"updatedFields": {
"filterCondition": "and",
"name": "view312"
},
"viewID": "645f37904444eb50dc9d63a8"
},
"extra": null,
"message": "OK",
"requestID": null
}