Summary
Dynamic text on a Button widget in ArcGIS Experience Builder is useful when the widget is required to automatically display specific text before and after a feature is selected on the map, while displaying the details of a feature’s particular attribute when it is selected.
In this article, the Button widget is configured to display the text 'Select a landmark’ by default and after a landmark feature is selected on the map, the landmark name is displayed.
Procedure
- In ArcGIS Experience Builder, click Create new, select the preferred template, and click Create.
- On the Insert widget panel, search for the Button widget, drag and drop it to the canvas.
- Click the Button widget. On the right panel, on the Content tab, configure the following settings.
- Turn on the Connect to data toggle.
- Under Connect to data, click Select data.
- Under Select data, click the Expand icon to expand the feature layer options of the Map widget, and select the desired feature layer.
- Under Connect to data, click the selected feature layer’s drop-down list options, and select Selected features.
- Under Text, click the Static icon to expand the text’s drop-down list options. Click Expression.
- Under Expression, in the first text box, specify the name of the dynamic text. For this example, 'Select a landmark' is specified.
- Under Expression, in the second text box delete the expression “Button” and select the desired attributes under Data to form an expression. For this example, the 'Name' attribute is selected.
- Click Insert on the bottom of the panel to complete the expression.
- Click Save to save the configurations.
The Button widget text changes dynamically, displaying the feature name when a feature is selected on the map.