Formulas
Data builder creates JSON (or YAML, if you prefer) objects using Recipes. Recipes look like this:
fieldFromVariable:
$var: $.someVariable
mappedField:
$map:
value: $.someVariable
mappinge:
- from: From Value 1
to: To Value 2
- from: From Value 2
to: To Value 2
By default, Data Builder will return its input as is. It will only do something if it encounters recipes.

List of Formulas

... work in progress

$case

Case formula selects a value based on a a list of conditions. It has the following structure:
conditionalValue:
$case:
# A list of cases,
# each containing optional `filter` and `value`
- filter:
# Each filter is a list of conditions
- field: status
operator: is
value: Won
# If all the contions are met, this value will be used.
value: "Status is Won"
# Value without `filter` acts as "else". It will always be used
# if none of the previous filters matched.
- value: "Status is not Won"
  • If filters of multiple cases match, the first one will be used
  • A case without a filter always matches.
  • Filter with zero conditions always matches.

$map

Map formula transforms a set of input values into corresponding output values.
mappedValue:
$map:
# Value that will be checked against the list of mappings below
value:
$var: $.status
mapping:
# Each mapping item has `from` and `to`.
# If `value` above matches `from`,
# then `to` will be used as the output of the formula.
- from: ToDo
to: Open
- from: In Progress
to: Open
- from: Done
to: Closed
# If none of the mappings matched, then default value will be used.
# If `default` is not specified and no mapping matched,
# the output will be empty.
default: "Unknown Status"

$copy

Copies another field from your value. Useful when you need the same value in two places and don't want to define it twice.
# Value
firstName:
$extractFirstName:
$var: fullName
preferredName:
$copy: firstName
​
# Variables
fullName: John Snow
​
# Result
firstName: John
preferredName: John

$findExternalRecordId

Finds id of a record in an external application matching record in your application using a provided Data Link Table.
# Will find a link in "person-to-lead" data link table
# with appRecordId equal 'leadId'.
# Will return externalRecordId from the link.
externalPersonId:
$findExternalRecordId:
dataLinkTable:
key: person-to-lead
recordId: 'leadId'

$findAppRecordId

Finds id of a record in you app that matches an external record id using a provided Data Link Table.
# Will find a link in "person-to-lead" data link table
# with externalRecordId equal 'personId'.
# Will return appRecordId from the link.
appLeadId:
$findAppRecordId:
dataLinkTable:
key: person-to-lead
recordId: 'personId'
Copy link
Outline
List of Formulas
$case
$map
$copy
$findExternalRecordId
$findAppRecordId