Use in-line formulas to format data in your step fields

With in-line formulas, you can transform text, numbers, and other data into the format you need. To set up in-line formulas, you add them inside the fields where you need to transform data–there’s no separate step required, unlike the Formatter app.

Add an in-line formula to a field

When setting up your action step:

  1. Click the plus sign icon at the end of a field to open the dropdown menu.
  2. In the top menu bar, select Formulas.
  3. Select a formula. The step will add it to the field’s input box.
  4. Replace all placeholder values between quotation marks with the values you want to transform.
    • You can double click the placeholder value to select it, then replace it with a mapped field.

View of the dropdown menu displaying in-line formula options on the left and the Message Text field on the right with the Text.concat formula selected.

 View of the Message Text field with the Util.strip_tags formula selected, containing a single mapped field as its value.

Example

If you want to remove HTML tags from the body of an email, you can use the Utils.strip_tags formula. Select it, then replace “value” with the body of the email. When the Zap runs, it will remove all HTML tags like <p></p> and return plain, unformatted text.

For the value:

<p>I would like to order two bunches of violets.</p> 
<p><strong>I do not want any that have been trod in the mud.</strong></p>
<p>Please reply with pricing.</p>
<p>Kindest regards,</p>
<p>Henry Higgins</p>

The Utils.strip_tags formula would output:

I would like to order two bunches of violets.
I do not want any that have been trod in the mud.
Please reply with pricing.
Kindest regards,
Henry Higgins
Tip

When you hover over an in-line formula in your field, a pop-up will appear that explains what the formula is and provides examples of how to use it.

View of the Message Text field with the Text.uppercase formula selected, with the Text.concat formula nested within it as its value. The Text.concat formulas contains the word Hello and a single mapped field as its values.

Limitations

  • You cannot combine static and dynamic values inside a formula.
    • Nest the Text.concat formula inside another formula to combine them first.
Example

View of the Message Text field with the Text.uppercase formula selected, with the Text.concat formula nested within it as its value. The Text.concat formulas contains the word Hello and a single mapped field as its values.

  • When you test a step that contains an in-line formula, the Data in tab will display the entire formula, not the transformed data. You can review the output in the live test result in your app instead.
  • List formulas will not accept CSV values.
    • You can use the Object.parse_json formula to parse it into a list the formula can accept. You can also add a Formatter step to transform your CSV into line items instead.
  • Deleting a formula does not delete its values. You must delete those separately.

Additional resources

Learn more about available in-line formulas and tips and tricks for using in-line formulas.

Was this article helpful?
0 out of 0 found this helpful