Create Data Actions in Visualizations Embedded in External Containers

You can embed visualizations in external containers, for example, an HTML page or consumer’s application page, and you can include data actions in the visualization. An embedded data action enables interacting with the embedded visualization in the external container. You can retrieve a set of data elements used in a visualization from an external container. You can add any number of embedded data actions.

The Publish Event enables external applications to receive the set of data element values in the selected visualization, known as the visualization context. The set of data element values in the selected visualizations mustn't be measure columns or hidden columns.

The event name is provided in the external container and is passed when you publish the context event. The context is the set of data element values at a selected location in the visualization. If the data action is used across multiple workbooks or multiple data elements in a workbook, you can provide a unique event name for easier tracking. For example, if you entered DV Embedded Content DA1 as the action name, then in the Event Name field, you might enter Event from DA1 to indicate which data action the event comes from.

Note the following when you enter Pass Values:
  • Use All to dynamically determine the intersection of the cell that you click, for example, "Product and Year", and passes those values to the target.
  • Use Anchor Data to ensure that the data action is displayed at runtime, but only if the required columns specified in the Anchor To field are available in the view context.
  • Use None to open the page (URL or canvas) but doesn't pass any data. For example, you might want to navigate to without passing any context.
  • Use Custom to specify a custom set of columns to pass.
Note the following when you select Supports Multiple Selection:
  • On - Invokes the data action when one or more data points are selected.
  • Off - Invokes the data action when a single data point is selected.

    This setting is particularly useful when the selection of multiple data points might result in an error, for example, with some third-party REST APIs.

After saving the workbook, you can embed the workbook in external containers. The external container shows the embedded visualizations. When you right-click the visualization and it includes applicable data actions, they’re displayed in the visualization in a drop-down menu. If you click an embedded data action, it determines the context information for the visualization and passes that information to the navigation action service to process it. The navigation service raises an event with the context payload information. You can subscribe to this event to receive the payload in the event callback and use the payload in other areas.

  1. On the Home page, hover over a workbook, click Actions (Actions menu ellipsis icon), then select Open.
  2. In the workbook, click Menu, and select Data Actions.
  3. Click Add Action. In New Data Action, go to Name and enter a name.
  4. Click Type and select Publish Event.
  5. Click Add Data or Select Data in the Anchor To field, and select one or more data elements that you want to pass values when the data action is applied.
  6. Enter an Event Name.
  7. Click the Pass Values field and select which values you want the data action to pass to the consumer.
  8. Click Supports Multiple Selection to set the value.
  9. Click OK to save.