MetricUpsert

Use this node to create or update a metric to a semantic model.

Asset Type Name for Rules 

Metric

Example Definition in chain.json 

1{
2  "name": "create_metric",
3  "label": "Creates a Metric",
4  "dominoVariant": "sfdc_internal__UnifiedAnalyticsDominoVariant",
5  "parameters": {},
6  "definition": {
7    "nodes": {
8      "upsert_metric": {
9        "graphNodeType": {
10          "name": "MetricUpsert"
11        },
12        "parameters": {
13          "name": "MyMetric",
14          "label": "My Metric",
15          "file": "metrics/metric.json",
16          "targetSdmApiName": "${Variables.TestSDMApiName}"
17        },
18        "sources": [],
19        "runAs": "CurrentUser"
20      }
21    }
22  }
23}

Parameters 

ParameterDefinition
name(Required) The developer name for the metric.
label(Required) The label for the metric.
file(Required) The path to the JSON file containing the metric definition.
targetSdmApiName(Required) The API name of the semantic model to add the metric to.
condition(Optional) An EL expression, evaluated at runtime, that determines whether to create this metric or not.

Set runAs to CurrentUser so that this node runs with the permissions of the user installing the app. If you omit runAs, the node runs as AutoProc, a system user.

Note

App Context Values 

Metrics created from a template get an entry in the App Context if they are successful. These entries are keyed off of the template specific asset name and contain information about the instance that was created.

App Context ValueDefinition
App.Metrics.<template specific asset name>.IdThe ID of the created metric.
App.Metrics.<template specific asset name>.NameThe developer name of the created metric.

On Failure 

If this task fails, it returns a FAIL_TERMINAL status. The chain stops and no downstream nodes run.

See Also