Find us at our new Help Center where we've combined our documentation and knowledgebase articles in one easy-to-search location.
We aren't updating the Developer Portal anymore, except for the Element Docs — all updates happen in the Help Center. We're retiring the Developer Portal as you know it in:
Formula templates enable you to build a single template for a formula that you can reuse with different elements and values. After you build a formula template, you can then create a formula instance where you replace the formula variable with actual element instances and values. This approach helps you build efficient and reusable formulas.
Formula templates include a trigger that kicks off the formula, steps that execute as a result of the trigger, and variables to represent input required to run an instance of the formula. You can build formulas that use triggers that kick off when something happens to an element instance, you can schedule triggers, or you can manually kick off a trigger. See Triggers, Steps, and Variables for more information about each component.
As you build a formula, you also build context consisting of triggers, variables, steps, and values created by steps. You can refer to that context in later steps in the formula. Consider each part as a building block that has a name and information that you can refer to. For example, in a formula that sends an email notification for a new contact, you build the body of the email in one step. In a later step when you actually send the message, refer to the step where you built the body.
To build a new formula template:
Enter a name for your formula, and then click Create.
Cloud Elements provides you a list of triggers. For details about each trigger, see Triggers, Steps, and Variables.
Select your trigger.
POST /formulas/instances/:id/executions
.Complete the trigger properties, which vary based on the selected trigger.
Click Save.
Cloud Elements shows the first trigger node in the formula visualization.
Add any variables that you will need to run the formula instance.
Select the type of variable, and then enter a name.
Takes note of the Formula Step Variable Name, which is how you will refer to the variable throughout the formula.
Click Save.
Add your first step. In the formula visualization, click .
Select the type of step that you want to add.
Complete the step properties, and then click Save. For details on each step, see Element Instance Variable.
Cloud Elements shows the first trigger node and the step that you just created in the formula visualization. The path from the trigger to the step defaults to On Success, but you can add failure steps later.
To add another step, click the step, and then select one of the following:
Continue adding steps until you complete the formula template.
Add a description by clicking Edit. See Add a Description to a Formula Template.
After you complete the formula, test it.
You can test a formula template as you build it. When you test a formula template, you can either use an existing formula instance or build a new formula instance.
To test a formula template:
You can create two types of variables: Element Instance variables — replaced by element instances in the formula instance — and Value variables — replaced by values entered in the formula instance. When you create a variable, note the Formula Step Variable Name which is how you refer to the variable in the formula context. See Formula Variables for more about variables in the formula context.
To create a formula variable:
key
in the JSON), which is how you refer to the variable in the formula context.You can edit the name of a variable or remove a variable from a formula template.
To edit or delete a formula variable:
You can troubleshoot formulas by reviewing executions. The executions appear in three columns from left to right:
To review executions
You can build a formula template based on an existing template or from a Cloud Elements sample formula, resulting in a copy of the template.
To build a copy of a formula template:
You can export a formula template as a JSON file and import other templates from their JSON source file.
To import a formula template:
To export a formula:
To help formula instances execute as efficiently as possible, they take advantage of multithreaded executions. That is, multiple executions of the same formula instance can make requests at the same time. Some API providers prevent multiple requests from the same account at the same time. If this happens, you can change a formula template or an individual formula instance to execute one step at a time. This makes the formula less efficient and results in an increase in the execution time.
To change a formula from the default multithreaded execution to single threaded:
Alternatively, in the formula template or formula instance JSON, update singleThreaded
to true
:
{
"singleThreaded": true
}
To rename a formula template:
Descriptions provide more information about a formula template. Use the information to describe the formula template use case and anything another user might need when creating a formula instance.
To add a description to a formula template:
You can delete a formula template if the template has no instances associated with it. If the formula template includes instances, delete those first.
To delete a formula template:
You can deactivate a formula template to prevent any executions of formula instances of the template.
To deactivate a formula:
Each formula template and formula instance exposes information about itself through the info
object.
{
"info":{
"formulaId":"123",
"formulaName":"name",
"formulaInstanceId":"123",
"formulaInstanceName":"name",
"formulaExecutionId":"1234"
}
}
Formula information contributes to the formula context. You can access the information with info.property
, such as info.formulaInstanceId
or info.formulaName
.