List View (Beta)

lightning:listView

Displays a List View of the specified object. This component requires API 42.0 and later.

For Aura components only. For LWC development, use lightning/uiListsApi.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App

lightning:listView is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer’s sole discretion.

Note

A lightning:listView component represents a list view of records that you own or have read or write access to, and records shared with you. They also include records owned by or shared with users in roles below you in the role hierarchy. You can see only the fields that are visible according to your page layout and field-level security settings.

To create a list view, specify which object to render with the objectApiName attribute and which list view to use with the listName attribute. The list view doesn’t require additional Apex controllers or Lightning Data Service to display record data.

This example displays a list view of Accounts with five rows. Each time “Load More” is clicked, five more rows are loaded and appended.

The action bar isn’t shown at the top of the component and the per-row actions are also hidden. However, the search bar, mass inline editing and inline editing of individual cells are available.

1<lightning:listView
2  aura:id="listViewAccounts"
3  objectApiName="Account"
4  listName="AllAccounts"
5  rows="5"
6  showSearchBar="true"
7  showActionBar="false"
8  enableInlineEdit="true"
9  showRowLevelActions="false"
10/>

Usage Considerations 

Links outside of Lightning Experience and Experience Builder sites appear as hyperlinks but don’t navigate to the link target. This is a known limitation that will be addressed in a future release.

lightning:listView supports the following features:

  • Inline editing
  • Mass inline editing for single record types
  • Resizing and sorting of columns
  • Search
  • Text wrapping
  • Loading of additional rows

You can configure inline editing. Other features aren’t configurable. Additionally, the following features are not supported via the lightning:listView UI.

  • Creating or deleting of list views
  • Modifying of the list view filter
  • Switching to other list views

If an invalid objectApiName or listName value is used, an error displays.

To retrieve list view names and object API names available in your org for the listName attribute, run this SOQL query.

1SELECT DeveloperName, SObjectType FROM ListView

The following objects are supported:

  • Account
  • Asset
  • Campaign
  • Case
  • Contact
  • ContentVersion
  • Contract
  • Entitlement
  • EntityMilestone
  • EnvironmentHubMember
  • Lead
  • MaintenancePlan
  • OperatingHours
  • Opportunity
  • Order
  • Product2
  • Pricebook2
  • Quote
  • ResourcePreference
  • ReturnOrder
  • ServiceAppointment
  • ServiceResource
  • ServiceTerritory
  • ServiceTerritoryMember
  • ServiceResourceSkill
  • ServiceCrew
  • ServiceCrewMember
  • ServiceContract
  • Shipment
  • SkillRequirement
  • SocialPost
  • Task
  • Tenant
  • TimeSheet
  • TimeSheetEntry
  • WorkType
  • WorkOrder
  • WorkOrderLineItem

Inline edit, row level actions, and the action bar are supported in Lightning Experience, the Salesforce app, and Experience Builder sites only.

If attempting to use these features outside of this context, they are automatically disabled and a warning displays.

On a desktop, this component renders a full list view. On all other form factors, such as a tablet or mobile devices, the component renders a mobile-friendly alternative.

Attributes 

NameDescriptionTypeDefaultRequired
bodyThe body of the component. In markup, this is everything in the body of the tag.Aura.Component[]
enableInlineEditSpecifies whether the inline edit of cells is enabled. This value defaults to false.Booleanfalse
listNameThe developer name of the List ViewString
objectApiNameThe API name of the object to be displayed in this List ViewString
rowsSpecifies the number of rows to initially load and additional rows after each subsequent 'Load More' click. The default and maximum number of rows value is 50.Integer50
showActionBarSpecifies whether the action bar displays. This value defaults to false.Booleanfalse
showRowLevelActionsSpecifies whether row level actions are displayed (as a dropdown menu in the last column of the row). This value defaults to false.Booleanfalse
showSearchBarSpecifies whether the search bar displays. This value defaults to false. Note: The server side may still disable search if it does not support searching.Booleanfalse