Contextual Action Button
Contextual Actions enable users to run actions directly from an Analytics chart (PA chart), displayed either standalone in the Data Analyzer menu, or in a dashboard portlet. These actions require access to the data / query associated with the chart. This section explains the Contextual Actions setup.
Configuration
Create a new application property named “pfxContextualAction_{nameOfYourAction}” with a JSON object with these fields:
name* (string) – Name of the button (unique within a partition).
labelTranslations (Map) – Text on the action button, provided potentially in several languages. For example
{ "" : "Create Watcher" }.page* (string) – Page on which the button should be displayed. It is a constant’s value from AppPages. For example
dataAnalyzerPageordashboardPage. You can restrict the display of the Create Action button for a custom list of pages. This list is defined in the button's configuration under the Advanced Configuration Options. This capability is particularly useful for embedded Dashboards. If you display a Dashboard within the Action or Quote header and want to prevent the Create Action button from appearing, you can configure it accordingly."page": ["dashboardPage", "actionPage"],order (integer) – If there are multiple buttons on the same page, this can be used to provide specific order. When not specified, ordering is done by labelTranslations.
conditionToShow (string) – Condition expression which decides if the button should be shown. Written in JavaScript, expected to return a Boolean value. The properties are in the placeholder {}, and will be replaced in the frontend code during runtime. Examples:
["PAQUERY", "MATRIX"].includes({resultType}) || {result.generatedSavedChart.series.length} > 0{typedId} != null["DATATABLE"].includes({chartDefinition.chartType}) && {chartDefinition.series.length > 0}
contextLinking* (Map) – All basic context linking parameters, such as targetPage, targetPageEntityType, targetPageInputs, targetPageFields, etc. For details see Context Linking Parameters. The variables placeholders will be provided from the frontend.
conditionToShow – The placeholders provide data from the CalculationResult of the logic element, such as:
resultType(string) – Constant’s value from CalculationResultType.result(Map) – The actual object returned from the logic element, represented as Map.
contextLinking – Variables will be provided by the frontend. The following variables/placeholders can be used:
dashboardName(String) – Unique name of the dashboard as defined in the dashboard configuration.dashboardInputs(Array<Map>) – List of input field names and their values.dashboardTypedId(String) – ID (with type) of the dashboard. Could be used, for example, in the target page to provide a link back to the original dashboard.
In version Caribou Lou 14.0, a typo in thedashboardTypedIdvariable was corrected. To maintain backward compatibility, both variants are supported and will function fully. You can use eitherdashboardTypedIdordashboardTypeddId.dashboardPreference(Map) – User preferences used for displaying the dashboard.portletName(String) – Name of the portlet is given by the name of the logic element which provided its content.portletLabel(String) – Label of the portlet is given by the label of the logic element which provided its content.
Placeholders for Page “dataAnalyzerPage”
conditionToShow – Placeholders provide data from the SavedChart (SC) object, such as:
typedId(string) – ID of the SavedChart. This value is null until the chart is actually rendered. For example, you can use it to show the action button only once the chart is rendered.chartDefinitionchartTypeserieslength
contextLinking – The variables will be provided by the frontend. The following variables/placeholders can be used:
queryBuilderState(Map)chartType(String)chartTypedId(String)chartLabel(String)