---
schema_version: "1"
id: eae398c996c1bc759baeb7ac6e452c2a3a2029175dce146f9de84a38af7cb329
title: DatasourceSortOrder
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/api/metadata_api/reference/datasourcesortorder.doc.md
canonical_url: https://help.tableau.com/current/api/metadata_api/en-us/reference/datasourcesortorder.doc.html
source_site: help.tableau.com
content_type: documentation
content_hash: 588d71f80bb5915fd03e3dd6490c585d7f5788b204f9f66a4bcac801ceeb17e1
---
_menu_ Types

INPUT\_OBJECT

# DatasourceSortOrder

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 DatasourceSortOrder {  - # GraphQL field to sort on - field: [DatasourceOrderField](https://help.tableau.com/current/api/metadata_api/en-us/reference/datasourceorderfield.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

- [Dashboard_A dashboard contained in a published workbook._](https://help.tableau.com/current/api/metadata_api/en-us/reference/dashboard.doc.html "Dashboard - A dashboard contained in a published workbook.")

- [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")

- [Sheet_A sheet contained in a published workbook._](https://help.tableau.com/current/api/metadata_api/en-us/reference/sheet.doc.html "Sheet - A sheet contained in a published workbook.")