- Get Record Data for a List View Using GET
- You can get record data for a list view using a GET request and URL parameters to modify the results.
-
As an example, let’s say we have a list view named All Accounts with a list view ID of 00BR0000000Wc0rMAC. To get information about all the records on this list view, make this request.
GET /services/data/v68.0/ui-api/list-records/00BR0000000Wc0rMACYou can also use the object API name and list view API name of the list view to make the same request.
GET /services/data/v68.0/ui-api/list-records/Account/AllAccountsTo get record data for the most recently used (MRU) list view for accounts, use the special __Recent list view API name.
GET /services/data/v68.0/ui-api/list-records/Account/__Recent - Modify the GET List View Results with URL Parameters.
- Modify the list view results using these URL parameters.
- fields—Additional fields queried for the records returned, for display purposes. If a field is specified and the user doesn’t have access to it, an error occurs.
- optionalFields—Additional fields queried for the records returned, for display purposes. If a field is specified and the user doesn’t have access to it, no error occurs.
- pageSize—The number of list records viewed at one time.
- pageToken—A token that represents the page offset.
- searchTerm—A search term to filter the results.
- sortBy—The API names of the fields the list view is sorted by.
- where—A where string, using GraphQL syntax, to filter the results.
For example, to sort records by the date they were created, set the sortBy parameter to CreatedDate.
GET /services/data/v68.0/ui-api/list-records/00BR0000000Wc0rMAC?sortBy=CreatedDate - Get Record Data for a List View Using POST
- You can also get record data for a list view using a POST request and a request body to modify the results.
- This example uses a request body to query a list view named All
Accounts.
POST /services/data/v68.0/ui-api/list-records/Account/AllAccountsThis example uses the special __Recent list view API name to get the record data for the most recently used (MRU) list view for accounts.{ "fields": ["Name", "Type", "AnnualRevenue", "CreatedDate"], "pageSize" : 10, "sortBy": ["CreatedDate"], "searchTerm" : "United", "where": "{AnnualRevenue: { gt: 1000000}}" }POST /services/data/v68.0/ui-api/list-records/Account/__Recent - Get Metadata for a List View
- You can get metadata for a list view using a GET request.
-
As an example, let’s say we have a list view named All Accounts with a list view ID of 00BR0000000Wc0rMAC. To get information about the metadata for this list view, make this request:
GET /services/data/v68.0/ui-api/list-info/00BR0000000Wc0rMACYou can also use the object API name and list view API name of the list view to make the same request:
GET /services/data/v68.0/ui-api/list-info/Account/AllAccountsTo get the most recently used (MRU) list view metadata for accounts, use the special __Recent list view API name.
GET /services/data/v68.0/ui-api/list-info/Account/__RecentTo get the search layout list view metadata for accounts, use the special __SearchResult list view API name.
GET /services/data/v68.0/ui-api/list-info/Account/__SearchResult
Use the List View resources to get record data and metadata about
list views displayed in the Salesforce UI.