The Table widget displays interactive attribute tables for feature layers and scene layers with an associated feature layer with the option to include multiple sheets that users access from tabs or a list. You can choose which fields to include in the table and turn on tools such as search and selection. Users can sort tables by one or multiple fields and by ascending or descending order.
Examples
Use this widget to support app design requirements such as the following:
- You want to display attribute tables.
- You want to provide a table for users to interact with, such as finding or sorting records, editing attributes, and selecting corresponding features in a map.
Usage notes
This widget requires that a data source be set for each sheet in the table. The Table widget supports feature layers and scene layers with an associated feature layer. You can set actions for a Table widget to interact with other widgets, such as zooming to the selected feature on a map in a Map widget or filtering rows in a List widget. You can also use this widget to display feature attributes without including a map in the app.
Tip:
For fields containing long strings, users can hover over any cell to view its entire value in a tooltip. URLs in cells are automatically shortened to View buttons and become live links.
Search methods
The Table widget's search tool uses different methods to retrieve search suggestions and search results.
The search tool uses full-text search to generate search suggestions. Full-text search is an efficient search method that uses full-text field indexes, which split up records into small units, such as individual words. For example, imagine you have a layer of United States Post Office locations with a name field containing the names of every post office location. The index splits the name Highland Station Baltimore Post Office into five individually searchable words: Highland, Station, Baltimore, Post, and Office. If you enter a search phrase made up of any combination of those words (or just the first part of any of them) such as Baltimore Office, Highland Baltimore, or Stat Balt Office, you get that office in the search suggestions.
Full-text field indexes are automatically generated for hosted feature layers when you select them as search fields for the Search, List, or Table widget if you are the owner of the hosted feature layer or an organization administrator. You can also manually add indexes to attribute fields on the layers item detail's page. If you have layers with no indexes and you do not have permission to edit the layers, the Table widget instead finds suggestions using START WITH abc%, meaning the widget looks for records that start with the search phrase. This is a less efficient search method.
To retrieve search results, the widget uses CONTAIN %abc%, meaning the search phrase can be anywhere in the record. For example, you can search for alt to get Baltimore, Salt Lake City, and Alton in search results.
Caution:
Full-text search is new with the Experience Builder October 2023 release and is a breaking change. Before this release, the widget used CONTAIN %abc% to retrieve both suggestions and results. Unlike CONTAIN %abc% queries, full-text search cannot find search phrases located in the middle of words. In the example above, searching for altimor or ighlan will not return the expected post office in search suggestions.
Settings
The Table widget includes the following settings:
- Source—Connect data to the widget in one of the following ways:
- Interact with a Map widget—Populate the table with layers from a Map widget. A drop-down menu lists all of the Map widgets in the app. The Table widget connects automatically to the first map on the current page.
- Any web maps or web scenes in the connected Map widget appear in a list. You can click the button to open the Select layers panel, where you can turn on Customize layers.
- The following behaviors apply when you turn on Customize layers:
- You can choose which map layers to display in the table.
- You can open the Sheet configuration panel for each map layer and configure settings for the layer.
- The widget does not honor layer visibility settings from the connected map widget. Only the layers you select in the widget's settings appear in the table.
- If you add or remove layers from the map at run time, those changes are not automatically synced to the table. However, you can use the View in table or Add to table data actions to manually add layers to a table.
- The following behaviors apply when you turn off Customize layers:
- The widget honor layer visibility settings from the connected Map widget. All visible layers appear in the table.
- Feature layers with no spatial data always display in the table.
- If you add or remove layers from the map at run time, those changes are synced to the table.
- You cannot change any of the default settings for any of the map layers.
- The following behaviors apply when you turn on Customize layers:
- Tools—You can turn on the following tool.
- Filter by map extent—Add a tool to the Table widget that filters the table based on the current map extent. You can choose to have this tool be enabled by default when the Table widget first loads.
- Any web maps or web scenes in the connected Map widget appear in a list. You can click the button to open the Select layers panel, where you can turn on Customize layers.
- Select layers—Add individual layers to the table.
- New sheet—Add a new sheet to the table. (Click the Remove button to remove a sheet from the table.) For each sheet, specify the following settings in the Sheet configuration panel:
- Data—Select a feature layer to display in the widget. In the data view settings, you can filter the data to restrict what appears in the widget, sort the data to display features in a particular order, or limit the number of features.
Tip:
You can add all layers from a web map to a Table widget at the same time by clicking the web map in the Select data panel.
- Last update text—Include text that says when the data last updated. This setting is only available if Auto refresh is turned on for the connected data source.
- Label—Type a name for the sheet. This name appears in the widget as a tab or in a list of sheets.
- Configure fields—Configure settings for the fields that appear in the sheet.
- Use layer settings—Use the layer's default settings to determine which fields appear for initial display, which fields are visible, and which fields are editable.
- Customize—Select the fields to include in the sheet. (The first 50 fields are automatically
selected; use the Clear selection button if needed.) Drag selected fields to reorder them. Click the Visible button to turn a column's visibility on or off when the widget first loads. (Users can change visibility at run time with the Show/hide columns tool.) If the data source supports editing, check the Allow editing check box to allow users who have access to the data to edit attributes by double-clicking in the table cells. You can choose which fields are editable. Lock icons appear in column headers for fields that can't be edited.
Note:
The Table widget does not support attachments.
Note:
When the user exports to JSON, CSV, or GeoJSON formats using the Export data action, only the fields you select for display are included in the export.
- Table options—Configure settings related to the table columns and header.
- Column sizing—Customize the size of the table columns. You can choose to have the columns fit the data or set an exact column width in pixels (px).
- Header options—Customize the header row that appears at the top of the sheet. You can apply bold formatting to the header text, change the font color, and change the font size in pixels (px). You can also choose the header background color.
- Tools—Turn on run time tools for interacting with the table.
- Search—Provide a search box for the sheet in the table.
- Select searching fields—Choose one or more fields to search.
- Exact match—Limit search results to only records that match the search phrase.
- Hint—Customize the hint text that appears in the search box.
- Select records—Allow users to select records in the sheet. Turning on this tool also includes Show selection (updates the sheet to only display the selected items) and Clear selection on the sheet's Options menu.
- Select mode—Allow users to select single or multiple records in the table.
- Show record count—Show counts of total and selected records.
- Refresh—Allow users to refresh the table to get the latest data.
- Delete records—Allow users to delete selected records. For Use layer settings, this setting appears if the layer allows deleting records. For Customize, this setting appears when you check the Allow editing check box and if the layer allows deleting records.
Note:
You must have editing privileges to use the Delete records feature.
- Search—Provide a search box for the sheet in the table.
- Data—Select a feature layer to display in the widget. In the data view settings, you can filter the data to restrict what appears in the widget, sort the data to display features in a particular order, or limit the number of features.
- New sheet—Add a new sheet to the table. (Click the Remove button to remove a sheet from the table.) For each sheet, specify the following settings in the Sheet configuration panel:
- Interact with a Map widget—Populate the table with layers from a Map widget. A drop-down menu lists all of the Map widgets in the app. The Table widget connects automatically to the first map on the current page.
- Arrangement style—Choose from Tabs or Dropdown to specify how users can switch between the sheets in the table.
Interaction options
This widget supports actions, which you can configure on the Action tab of the widget's settings.
Message actions are useful for creating interactions between widgets. For example, you can make a map zoom to features when the user selects them in a table by adding the Record selection changes trigger in the Table widget's Action settings, setting a Map widget as the target, and adding the Zoom to message action.
Turn on data actions to add buttons to the widget's user interface for performing data processing tasks, such as exporting and filtering. For example, you can turn on the Set filter data action to allow users to set table filters with SQL expressions at run time.
There are two table-related data actions that you turn on in the settings of other widgets, View in table and Add to table. Both are for sending records from another widget to a table. The difference is in which records. Add to table is a data source level action, meaning it sends all records in an entire data source to the Table widget. View in table is a records level data action, meaning it only affects selected, current, or loaded records.
A Table widget can target itself with the View in table data action. This is useful if you want to, for example, select some records and view them in a new sheet in the same table.
The following table lists which widgets and data actions you can use to view which records in a Table widget.
Add to table | View in table | |||
---|---|---|---|---|
Source widget | All records | Selected records | Loaded records | Current record |
Add Data | ||||
Analysis | ||||
Chart | ||||
Feature Info | ||||
List | ||||
Map | ||||
Map Layers | ||||
Query | ||||
Select | ||||
Table |