Skip to main content
Version: 4.10.1

Playbook datapills guide

Practical guide for configuring datapills in playbook, which allows you to reference runtime values during playbook execution.

When to Use​

  • You have an activity input or experience property that needs to be set to the output, state, or sysId of another activity
  • You have an activity input or experience property that gets its value from a playbook input
  • You have an activity input or experience property that gets its value from a field in the parent record
  • You are providing a playbook parent record from a trigger record
  • You are setting a playbook input value based on a field in the trigger record
  • You have an activity input or experience property that needs to match the activity's label or description
  • You have an activity input or experience property that needs the value of the playbook state
  • You have a condition to run that uses the output of a previous activity

wfa.playbook.dataPill()​

Creates runtime references to playbook data for use in trigger mappers, activity inputs, experience properties, conditions, and timer fields.

wfa.playbook.dataPill(reference: DataReference): string

Pill Sources​

SourceExample
params.inputs.*wfa.playbook.dataPill(params.inputs.record.number)
params.statewfa.playbook.dataPill(params.state)
params.parentRecord.*wfa.playbook.dataPill(params.parentRecord.short_description)
trigger.current / trigger.current.* (mapper only)wfa.playbook.dataPill(trigger.current.short_description)
Activity outputs (same lane)wfa.playbook.dataPill(validate.outputs.record.state)
Activity outputs (cross-lane)wfa.playbook.dataPill(intake.enrich.outputs.support_tier)
Activity statewfa.playbook.dataPill(validate.state)
Activity sysIdwfa.playbook.dataPill(validate.sysId)
Current activity labelwfa.playbook.dataPill(wfa.playbook.currentActivity.label)
Current activity descriptionwfa.playbook.dataPill(wfa.playbook.currentActivity.description)

trigger.current and trigger.current.* are only available inside the optional playbookInputs mapper callback passed to wfa.playbook.trigger(...). They are not available in lane/activity fields like params.inputs.* and params.parentRecord.*.

Pill Format Reference​

Standard format (activity inputs, experience properties, startWithDelay timer fields):

Fluent expressionPlatform format
params.inputs.varName{{pd.inputs.varName}}
params.inputs.varName.field{{pd.inputs.varName.field}}
params.state{{pd.state}}
params.parentRecord{{pd.inputRecord}}
params.parentRecord.field{{pd.inputRecord.field}}
activityVar.outputs.field{{act.<sysId>.outputs.field}}
activityVar.state{{act.<sysId>.state}}
activityVar.sysId{{act.<sysId>.outputs.sys_id}}
wfa.playbook.currentActivity.label{{act.<sysId>.label}}
wfa.playbook.currentActivity.description{{act.<sysId>.description}}

Condition format (conditionToRun on lanes/activities, Decision branch condition):

Fluent expressionPlatform format
params.inputs.varNameinputs.varName
params.inputs.varName.fieldinputs.varName.field
params.parentRecord.fieldinput_record.field
activityVar.outputs.fieldactivity_<sysId>.outputs.field
activityVar.stateactivity_<sysId>.state

Note: activityVar.sysId is not available in condition format.

Pill Validation Matrix​

Target fieldFormatparams.inputs.*params.stateparams.parentRecord.*Activity outputsActivity stateActivity sysIdCurrent activity label/desc
Activity inputsStandardYesYesYesYesYesYesYes
Activity experience propertiesStandardYesYesYesYesYesYesYes
startWithDelay fieldsStandardYesYesYesYesYesYesNo
Activity conditionToRunConditionYesNoYesYesYesNoNo
Lane conditionToRunConditionYesNoYesYesYesNoNo
Decision branch conditionConditionYesNoYesYesYesNoNo

A diagnostic error is emitted if a wfa.playbook.dataPill() call is used in any field not listed above.

wfa.playbook.currentActivity​

Allows an activity's inputs or experience properties to reference its own label or description. Use this instead of the activity variable to avoid "variable used before declaration" TypeScript errors:

const myActivity = wfa.playbook.activity(
ActivityDefinitions.Core.RecordForm,
{ $id: Now.ID['my_form'], label: 'Review Incident', ... },
{ /* inputs */ },
{
title: wfa.playbook.dataPill(wfa.playbook.currentActivity.label),
description: wfa.playbook.dataPill(wfa.playbook.currentActivity.description),
}
)

Only label and description are valid after wfa.playbook.currentActivity. Any other property access produces a diagnostic error.

_tableName pill​

_tableName is a property that is appended to pill sources to have the data pill reference the table name of a record reference. For example, wfa.playbook.dataPill(params.parentRecord._tableName) will reference the table name of the record referenced by params.parentRecord.

_tableName is not available in condition pills, and only applicable to references, not primitive values.

Examples of _tableName usage​

wfa.playbook.dataPill(params.parentRecord._tableName)
wfa.playbook.dataPill(params.parentRecord.subRecord._tableName)
wfa.playbook.dataPill(params.inputs.recordInput._tableName)
wfa.playbook.dataPill(params.inputs.recordInput.subRecord._tableName)
wfa.playbook.dataPill(trigger.current._tableName)
wfa.playbook.dataPill(trigger.current.subRecord._tableName)
wfa.playbook.dataPill(activityVar.outputs.record._tableName)
wfa.playbook.dataPill(activityVar.outputs.record.subRecord._tableName)

Examples of disallowed _tableName usage (using it with primitives)​

wfa.playbook.dataPill(params.parentRecord.active._tableName)
wfa.playbook.dataPill(params.inputs.boolInput._tableName)
wfa.playbook.dataPill(trigger.current.active._tableName)
wfa.playbook.dataPill(activityVar.outputs.boolOutput._tableName)
wfa.playbook.dataPill(wfa.playbook.currentActivity.label._tableName)
wfa.playbook.dataPill(activityVar.state._tableName)