When you’d like the user to be able to to run some action directly from within an Analytics Chart (PA Chart), which is Contextual Actions enable users to run actions directly from an Analytics chart (PA chart), displayed either standalone in the Data Analyzer menu, or inside in a portlet of a dashboard, and this action would need to know dashboard portlet. These actions require access to the data / query of associated with the chart, you can set up a Contextual Action for the chart. This section explains the Contextual Actions setup.
Configuration
Create a new application property with name named “pfxContextualAction_{nameOfYourAction}” with a JSON object with these fields:
name* (string) - – Name of the button (unique within a partition).
labelTranslations (Map) - Test – Text on the action button, provided potentially in several languages. For example
{ "" : "Create Watcher" }
.page* (string) - page – Page on which the button should be displayed. It’s It is a constant’s value of constant from AppPages. For example
dataAnalyzerPage
ordashboardPage
. 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.Code Block language json "page": ["dashboardPage", "actionPage"],
order (integer) - – If there are multiple buttons in 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 booleanBoolean value. The properties are in the placeholder {}, and will be replaced on front-end in the frontend code during runtime. Examples of value:
Code Block ["PAQUERY", "MATRIX"].includes({resultType}) || {result.generatedSavedChart.series.length} > 0
Code Block {typedId} != null
Code Block ["DATATABLE"].includes({chartDefinition.chartType}) && {chartDefinition.series.length > 0}
contextLinking* (Map) - – All basic context linking parameters, such as targetPage, targetPageEntityType, targetPageInputs, targetPageFields, etc. Read more about For details see Context Linking Parameters. The variables placeholders will be provided from front-endthe frontend.
Placeholders for
...
Page “dashboardPage”
Anchor | ||||
---|---|---|---|---|
|
conditionToShow - the placeholders provides you – The placeholders provide data from the CalculationResult of the logic element, likesuch as:
resultType
: (string - ) – Constant’s value of constant from CalculationResultType.result
: Map - the (Map) – The actual object returned from the logic element, represented as Map.
contextLinking - the variables – Variables will be provided from front-end. Following by the frontend. The following variables/placeholders can be used:
dashboardName
: String - unique (String) – Unique name of the dashboard as defined in the dashboard configuration.dashboardInputs
: Array<Map> - list (Array<Map>) – List of input field names and their values.dashboardTypeddId
: String -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 thedashboardTypedId
variable was corrected. To maintain backward compatibility, both variants are supported and will function fully. You can use eitherdashboardTypedId
ordashboardTypeddId
.dashboardPreference
: Map - user (Map) – User preferences used for displaying the dashboard.portletName
: String - name (String) – Name of the portlet is given by the name of the logic element , which provided it's its content.portletLabel
: String - label (String) – Label of the portlet is given by the label of the logic element , which provided it's its content.
Placeholders for
...
Page “dataAnalyzerPage”
conditionToShow - the placeholders provides you – Placeholders provide data from the SavedChart (SC) object, likesuch as:
typedId
: string - Id (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.chartDefinition
chartType
series
length
contextLinking - the – The variables will be provided from front-end. Following by the frontend. The following variables/placeholders can be used:
queryBuilderState
: (Map)chartType
: (String)chartTypedId
: (String)chartLabel
: (String)