Answer
No, the Text widget cannot simultaneously display dynamic content from multiple map layers in ArcGIS Experience Builder. By design, a dynamic text expression can be configured to display the content of only one layer. However, an experience can be configured to display dynamic content from multiple layers by specifying the expression for each layer and overlaying multiple Text widgets at the same position on the canvas. In this article, the experience is configured to display dynamic content from two map layers depending on the selection in the map.
- Open the ArcGIS Experience Builder project.
- In the Insert widget panel, on the New tab, under the Map centric group, drag and drop the Map widget onto the desired position on the canvas. Refer to ArcGIS Experience Builder: Map widget to configure the map widget. Change the widget style settings if required.
- Add the Text widget and connect it to the map layer.
- In the Insert widget panel, on the New tab, under the Page elements group, drag and drop the Text widget onto the canvas. Change the widget style settings accordingly.
- In the Text pane, on the Content tab, toggle Connect to data on, and click Select data.
- In the Select data pane, click Expand next to the added web map, and select the input layer for the dynamic content. In this example, the 'SNAP Store Locations' layer is selected.
- Configure the dynamic text message to display the content from the map layer.
- On the canvas, click the Text widget, and click Dynamic content to open the Dynamic content pane.
- In the Dynamic content pane, click Expression.
- For the expression title, highlight the default title 'Expression', and press the Spacebar key. More information can be found in this article, Problem: A field name variable is displayed when there is no data selected on a map in ArcGIS Experience Builder.
- In the expression editor, specify the expression for the dynamic text message. In this example, "Store name: " + {Store Name}, is specified.
- For Data, in the first drop-down menu, ensure the correct map layer is selected. In this example, it is SNAP Store Locations.
- In the second drop-down menu, ensure Selected features is selected.
- Click Insert.
- Repeat Steps 3 and 4 to add the second Text widget and configure it to connect to the other map layer.
- On the canvas, drag the second Text widget to overlay the first Text widget.
Note:
If background color is required for the Text widgets, on the canvas, configure the background color for the bottom-most widget only. This ensures the background color does not obstruct the text message display.
- Click Save and Publish to publish the experience.
The experiences below show the dynamic text messages displayed depending on the selected feature layers.