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
| Source | Example |
|---|---|
params.inputs.* | wfa.playbook.dataPill(params.inputs.record.number) |
params.state | wfa.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 state | wfa.playbook.dataPill(validate.state) |
| Activity sysId | wfa.playbook.dataPill(validate.sysId) |
| Current activity label | wfa.playbook.dataPill(wfa.playbook.currentActivity.label) |
| Current activity description | wfa.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 expression | Platform 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 expression | Platform format |
|---|---|
params.inputs.varName | inputs.varName |
params.inputs.varName.field | inputs.varName.field |
params.parentRecord.field | input_record.field |
activityVar.outputs.field | activity_<sysId>.outputs.field |
activityVar.state | activity_<sysId>.state |
Note: activityVar.sysId is not available in condition format.
Pill Validation Matrix
| Target field | Format | params.inputs.* | params.state | params.parentRecord.* | Activity outputs | Activity state | Activity sysId | Current activity label/desc |
|---|---|---|---|---|---|---|---|---|
| Activity inputs | Standard | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Activity experience properties | Standard | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
startWithDelay fields | Standard | Yes | Yes | Yes | Yes | Yes | Yes | No |
Activity conditionToRun | Condition | Yes | No | Yes | Yes | Yes | No | No |
Lane conditionToRun | Condition | Yes | No | Yes | Yes | Yes | No | No |
Decision branch condition | Condition | Yes | No | Yes | Yes | Yes | No | No |
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)