getListRecordsByName

Use this wire adapter to get record data for a list view.

See Get List View Records.

  • objectApiName–(Required) The API name of a supported object.
  • listViewApiName–(Required) The API name of a list view, such as AllAccounts.
  • fields–Additional fields queried for the records returned. These fields don’t create visible columns. If the field isn’t available to the user, an error occurs.
  • optionalFields–Additional fields queried for the records returned. These fields don’t create visible columns. If the field isn’t available to the user, no error occurs and the field isn’t included in the records.
  • pageSize–The number of list records viewed at one time. The default value is 50. Valid values are 1—2000.
  • searchTerm–A search term to filter the results. Wildcards are supported.
  • sortBy–The API name of the field the list view is sorted by. If the name is preceded with -, the sort order is descending. For example, Name sorts by name in ascending order, and -CreatedDate sorts by the created date in descending order. This parameter accepts only one value per request.
  • where–The filter applied to returned records, in GraphQL syntax. For example, { and: [ { StageName: { eq: "Prospecting" } }, { Account: { Name: { eq: "Dickenson plc" } } } ] } filters an Opportunity related list to show only opportunities in the Prospecting stage that are linked to the "Dickenson plc" account.
  • pageToken–A token that represents the page offset. To indicate where the page starts, use this value with the pageSize parameter. The maximum offset is 2000 and the default is 0.

Read the data that's returned by the wire adapter using a property or function.

propertyOrFunction—A private property or function that receives the stream of data from the wire service.

  • If a property is decorated with @wire, the results are returned to the property’s data property or error property.
  • If a function is decorated with @wire, the results are returned in an object with a data property and an error property.

This code example fetches list view records by API name then iterates through the list of records.

See Also