---
schema_version: "1"
id: f58629c1ae1ac49ea937b517e33bfdfcd9a9c44d2bbfe4b1986da4b59b21d340
title: CustomSQLTableSortOrder
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/api/metadata_api/reference/customsqltablesortorder.doc.md
canonical_url: https://help.tableau.com/current/api/metadata_api/en-us/reference/customsqltablesortorder.doc.html
source_site: help.tableau.com
content_type: documentation
content_hash: 3d491bdf794227814e513af48dea6b76aaa7ed8153ad2a451afa005f1fdfe05d
---
_menu_ Types

INPUT\_OBJECT

# CustomSQLTableSortOrder

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

- [CloudFile_A cloud file connection_](https://help.tableau.com/current/api/metadata_api/en-us/reference/cloudfile.doc.html "CloudFile - A cloud file connection")

- [Database_A database containing tables_](https://help.tableau.com/current/api/metadata_api/en-us/reference/database.doc.html "Database - A database containing tables")

- [DatabaseServer_A database server connection_](https://help.tableau.com/current/api/metadata_api/en-us/reference/databaseserver.doc.html "DatabaseServer - A database server connection")

- [DatabaseTable_A table that is contained in a database_](https://help.tableau.com/current/api/metadata_api/en-us/reference/databasetable.doc.html "DatabaseTable - A table that is contained in a database")

- [DataCloud_A Data Cloud connection \*Available in Tableau Cloud February 2024 / Server 2024.2 and later.\*_](datacloud.doc.html "DataCloud - A Data Cloud connection  
    *Available in Tableau Cloud February 2024 / Server 2024.2 and later.*")

- [File_A file connection_](https://help.tableau.com/current/api/metadata_api/en-us/reference/file.doc.html "File - A file connection")

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

- [WebDataConnector_A web data connector_](https://help.tableau.com/current/api/metadata_api/en-us/reference/webdataconnector.doc.html "WebDataConnector - A web data connector")