You can do the following to create dynamic and interactive apps with Experience Builder:
- Connect widgets with data and configure them with dynamic content.
- Configure interactions between a widget and the framework (data source).
- Configure interactions between widgets.
You can add two types of actions to widgets: message actions and data actions. Message actions listen to triggers and perform actions automatically, such as filtering a list to show only records within a map’s current extent. Data actions provide an Actions button that users can click in widgets at run time and select from a list of actions to perform, such as exporting records to a file or as an ArcGIS item.
Message actions
Experience Builder apps are data driven, which means that the data displayed by widgets can change universally when the underlying data updates. You can define interactions between a widget and the data by configuring message actions in response to triggers. For example, you can create an interaction so that when the Map widget changes its extent, the other widgets (such as a List widget) are filtered and display only features within the current extent. To do this, set Extent changes in the Map widget as a trigger and set Filter data records in the data view used by the List widget as an action. Because the widgets are data driven, the filter action is applied to the data at the framework level and every widget using the same data view is synchronized automatically. You can also define interactions between widgets. Actions provided by a widget only take effect in that widget. For example, you can synchronize the extent of two Map widgets when users zoom or pan one of them by setting Extent changes of one Map widget as a trigger and change the extent of the other Map widget as an action.
These interactions are defined and managed in the Action panel of the source widget that provides the triggers. The Message action configurations have three parts:
- Triggers from the source widget
- Targets that respond to the trigger (widgets and the app framework)
- Actions from the target related to its intended use
The source widget’s trigger can only be added once; however, you can add multiple actions for that specific trigger from the same or a different target.
Triggers
Triggers are events generated by the source widget. Once a trigger occurs, any actions added to it are run in response. The following table describes the five triggers that are currently supported:
Trigger | Description |
---|---|
Button click | A trigger occurs when the Button widget is clicked. |
Data filtering changes | A trigger occurs when a filter is applied to the data source. |
Extent changes | A trigger occurs when the map’s extent changes through panning, zooming, resizing, and so on. |
Record selection changes | A trigger occurs when a record is selected or a selected record is cleared. |
Records created | A trigger occurs when result records are loaded in the source widget. |
Data added | A trigger occurs when a data source is added with the Add Data widget. |
To view a widget’s available triggers, open its settings and click Add a trigger on the Action tab. The following table lists source widgets and their supported triggers:
Source widget | Button click | Data added | Data filtering changes | Extent changes | Record selection changes | Records created |
---|---|---|---|---|---|---|
Add Data | ||||||
Button | ||||||
Chart | ||||||
Feature Info | ||||||
Filter | ||||||
List | ||||||
Map | ||||||
Near Me | ||||||
Query | ||||||
Search | ||||||
Select | ||||||
Table | ||||||
Utility Network Trace |
Caution:
Selecting a high number of features with the Chart widget or Map widget may overwhelm the Record selection changes trigger and cause Experience Builder to not perform the expected action.
Targets
Targets perform the actions. A target can be a widget or the framework. If you use the framework as the target, the action is performed globally—throughout all relevant widgets and pages in the app.
Actions
Unlike the triggers that are defined by the framework, actions are provided by targets (especially widgets) to perform specific business logic. Some actions may need additional configuration depending on how the target responds to the message from the trigger. For example, if you’re configuring a filter action for a data view and the trigger is based on different data, you can filter the target data view by establishing an attribute or spatial relationship. You can also set SQL conditions.
If you want to establish an attribute relationship between a trigger field and an action field, the records in the trigger field must exactly match the records in the action field, including capitalization.
Different targets provide different actions that correspond to different triggers. Available actions appear once you add a trigger and select the target. The following table lists targets and their corresponding actions:
Target | Action1 | Trigger: Data added | Trigger: Data filtering changes | Trigger: Record selection changes | Trigger: Extent changes | Trigger: Records created |
---|---|---|---|---|---|---|
Framework | Filter data records—Keep only the records in the data view that meet the conditions for further display or processing through the app. | |||||
Select data records2—Mark the records as selected and put them into the Selected features view. | ||||||
Business Analyst widget | Select feature—Mark the feature as selected. | |||||
Elevation Profile widget | Select line—Mark the line feature as selected and generate an elevation profile. | |||||
Map widget | Add to map—Add data to the web map or scene as a layer. | |||||
Pan to3—Keep the current scale and center on a specified location. | ||||||
Zoom to4—Zoom to a specified location. | ||||||
Flash—Flash a feature on the map. | ||||||
Filter—Keep only the features that meet the conditions for viewing in the Map widget. | ||||||
Show on map5—Display the created records on the map as a new layer. | ||||||
Near Me widget | Set location—Define the search location and find nearby features. |
1For framework actions, if the action data is the default view, the action affects all widgets using the data and its views. If the action data is a specified view, the action only affects the widgets using that view. For widget actions, the action is only performed on the target widget. (For example, the map filter action only filters the records in the map and doesn’t affect all other widgets using the same layer.)
2The selected state of a record is synchronized throughout the app and the selected records are saved in the data’s Selected features view. Widgets may have a different configuration for displaying a selected record.
3If a Map widget is configured with both the Zoom to and Pan to actions, the Zoom to action takes precedence. This means that if the user pans and zooms the map at the same time, the Pan to action is ignored.
4When you add a Zoom to action, you can change the Zoom scale settings in the Action settings window. Choose Custom to adjust the zoom level of the map, or choose Automatic to use the map's default scale. The Zoom to action includes the rotate behavior for web maps and web scenes and the tilt behavior for web scenes.
5When you add a Show on map action, you can customize the symbols for created records. Choose Use custom symbols to customize the fill, outline, transparency, and more for points, lines, and polygons. Choose Use layer defined symbols to use symbols from the layers associated with the current action in the source widget.
Button actions
You can use a Button widget to trigger actions in other widgets. Currently, the Button click trigger supports the following action.
Target | Action |
---|---|
Sidebar widget | Toggle sidebar—Open or close the sidebar. |
Data actions
You can configure data actions for users to process data in the app at run time. They can click the Actions button on source widgets and pass a dataset to a specific widget (such as viewing query results in a table) or the app framework (to export data).
These interactions are defined and managed in the Action panel of the source widget that provides the run time dataset. The data action configurations have two parts:
- Targets that receive the dataset (widgets and the app framework)
- Data actions provided by the target, performed only when users specify an action
The dataset passed to the target varies depending on the source widget. For example, the Chart widget passes all statistic data to the Table widget, regardless of whether a selection exists.
The following table lists available source widgets, targets, and supported data actions (target: data action):
Source widget | Framework: Export | Framework: Set filter | Framework: Statistics | Directions: Directions from | Directions: Directions to | Elevation Profile: View elevation profile | Map: Pan to | Map: Show on map1 | Map: Zoom to | Map: Add to map2 | Near Me: Set location | Table: Add to table | Table: View in table3 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Analysis | |||||||||||||
Add Data | |||||||||||||
Chart | |||||||||||||
Feature Info | |||||||||||||
List | |||||||||||||
Map | |||||||||||||
Map Layers | |||||||||||||
Near Me | |||||||||||||
Query | |||||||||||||
Select | |||||||||||||
Table |
1When you add a Show on map action, you can customize the symbols for created records.
2You cannot add the same layer from the Add Data widget to a map multiple times. Once you use the Add to map data action with the Table or Add Data widget, it disappears as an option for that layer in both widgets. If you configure the Analysis widget to add result layers to the map automatically, Add to map is unavailable as a data action for those results.
3You can add many types of data with the Add Data widget, but only data types that the Table widget supports (feature layers and scene layers with associated feature layers) can trigger the Add to table data action.
When a data action is performed on a target widget, the target widget includes a button for clearing it. For example, when a user selects data in a List widget and chooses to view the selection in a Table widget, a button appears next to the new sheet that allows them to remove the sheet from the table. Similarly, when they choose the Show on map data action, a button appears in the map to clear it from the map. (Refreshing the page clears all data action results.)
Note:
Beginning with the ArcGIS Enterprise 11.3 release, Experience Builder only loads necessary fields in order to improve performance. For example, if a widget is configured to use certain fields from a data source, Experience Builder only loads those fields. Because of this, unloaded fields may not appear when you run the Statistics data action. If you want to view statistics for more fields, you can use the View in table or Add to table data actions to view data in a Table widget at run time, and use the Table widget's Statistics data action.
Data action levels
Data actions can affect some or all of the data from a source widget. Data actions that affect all the records in an entire data source are called data source level actions. Data actions that only affect selected records, loaded records, or the current record are called record level actions.
The following table lists source widgets and their supported levels of data actions:
Source widget | Data source level | Record level | ||
---|---|---|---|---|
All records | Selected records | Loaded records | Current record | |
Add Data | ||||
Chart | ||||
Feature Info | ||||
List | ||||
Map | ||||
Map Layers | ||||
Near Me | ||||
Query | ||||
Select | ||||
Table |
The following table lists all of the possible targets and their supported data action levels:
Target | Action | Data source level | Record level |
---|---|---|---|
Elevation Profile | View elevation profile | ||
Directions | Directions from | ||
Directions to | |||
Framework | Export | ||
Set filter | |||
Statistics | |||
Map | Zoom to | ||
Pan to | |||
Show on map | |||
Add to map | |||
Near Me | Set location | ||
Table | Add to table | ||
View in table |
Configure interactions
Configure message actions and data actions in the Action panel of the source widgets.
Configure message actions
Message actions are configured in the settings of the source widgets (the widgets that provide triggers).
To configure message actions, complete the following steps:
- In the Action panel, on the Message action tab, click Add a trigger.
- Select the trigger, select the target, and add and select the actions.
Some actions, such as Filter, Flash, and Select Data Records, require additional configuration. The Action settings options appear when you select the action. Each trigger can only be added once.
- To add multiple actions for the same trigger, click Add action.
Actions for the same trigger occur in sequential order.
- Drag the actions grouped under a trigger to change the order.
- To modify these configured settings later, click the action’s Settings button .
- To change an action or target after adding an action, delete it and add a new one.
Deleting a trigger also deletes all the actions added to it.
Configure data actions
Data actions are configured in the settings of the source widgets, with the exception of Export, which is configured for the data source in the Data panel. Data actions are enabled by default, and the widget's Actions button automatically includes all its available data actions.
To configure data actions, complete the following steps:
- In the Action panel, on the Data action tab, uncheck or check the data actions to specify the options for the widget's actions menu. Otherwise, turn off Enable data action to exclude the Actions button from the widget.
- For each checked data action, select target widgets for the source widget to interact with, such as a Map widget.
You can only select target widgets that are on the same page as the source widget.
Note:
When you add a target widget to a page, its corresponding data actions are automatically added to available source widgets on the same page.
Tip:
For best results, position the source widget next to the target widget because data actions don't jump to the target location in the app.
- To exclude the Export data action, go to the Data panel and turn off Allow export for the data source.
Example usage
Add message actions to support app design requirements such as in the following scenarios:
- You want to build an app that compares two maps, two scenes, or a map and a scene, so the extents of the two Map widgets should always be synchronized. You can add an Extent changes trigger to both widgets, select the other widget as the target for each, and choose the Pan to or Zoom to action.
- You add a List widget next to a Map widget and you want the list to only display the records within the map’s current extent. You can add an Extent changes trigger to the Map widget, select the Framework Filter Data Records action, choose the action data as the data view configured in the List widget settings, and configure the action with a spatial relationship to the extent.
Use data actions to support app design requirements such as in the following scenarios:
- You add a Chart widget to represent a set of
numerical or qualitative data as a graph, and you want to provide the
user an option to view statistics data generated by the chart
in a Table widget. When you add a Table widget next to the Chart
widget, the View in table data action is added to the Chart
widget automatically. At run time, the user can click the
Actions button in the Chart widget and select View in table to display the statistics data in the Table widget.
Tip:
If the target widget, which in this example is the Table widget, is located in a Widget Controller widget, the target widget automatically opens in the Widget Controller when the user activates the data action.
- You add a List widget to display a data record and a Map widget to display a different data record. You want to provide the user an option to show a feature on the map that corresponds with a record selected in the list to compare different data on one map. At run time, the user can click the Actions button in the List widget and select Show on map.
- You display data records in a Table widget and want users to have the option to export the data. With Allow export enabled for the data source, they can click the Actions button on the Table widget and export selected records or all records.