---
schema_version: "1"
id: b5a5e141958aeb7280f08f3e0eb8cfb168f63ff861321ac28a7bb350d1d229e5
title: ViewSortOrder
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/api/metadata_api/reference/viewsortorder.doc.md
canonical_url: https://help.tableau.com/current/api/metadata_api/en-us/reference/viewsortorder.doc.html
source_site: help.tableau.com
content_type: documentation
content_hash: b7e6111a951773a1d21c4aed31d76b7451d98f32b4b14e01cebfd0ce0fb5fd50
---
_menu_ Types

INPUT\_OBJECT

# ViewSortOrder

Sort by given fields. The sort orders defined first in the list will take priority. If there are no given sort orders or a tie on the final sorted field then the resulting set will be sorted by ID in ascending order.

## [_link_](#graphql-schema-definition) GraphQL Schema definition

`   - input ViewSortOrder {  - # GraphQL field to sort on - field: [ViewOrderField](https://help.tableau.com/current/api/metadata_api/en-us/reference/vieworderfield.doc.html)!  - # Order direction to sort output - direction: [OrderDirection](https://help.tableau.com/current/api/metadata_api/en-us/reference/orderdirection.doc.html)! - }   `

## [_link_](#require-by) Require by

- [Query_Query root for Metadata GraphQL interface_](https://help.tableau.com/current/api/metadata_api/en-us/reference/query.doc.html "Query - Query root for Metadata GraphQL interface")

- [Tag_A tag associated with content items_](https://help.tableau.com/current/api/metadata_api/en-us/reference/tag.doc.html "Tag - A tag associated with content items")

- [Workbook_Workbooks are used to package up Tableau visualizations (which are called "sheets" in the Metadata API) and data models (which are called "embedded data sources" when they are owned by a workbook)._](https://help.tableau.com/current/api/metadata_api/en-us/reference/workbook.doc.html "Workbook - Workbooks are used to package up Tableau visualizations (which are called \"sheets\" in the Metadata API) and data models (which are called \"embedded data sources\" when they are owned by a workbook).")