For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Login
HomeDocs
HomeDocs
    • Work with scripted bots
    • Before you begin
    • Build and maintain your bot
      • Work with blocks and apps
        • Build Answers using blocks
        • Serve content using Message blocks
        • Save chatter information using the Capture block
        • Save content in variables using the Set Variable block
        • Target content to chatters using the Conditional block
        • Create selectable menus using the List Option block
        • Serve time-specific content using the Scheduled block
        • Make API requests using the HTTP Request block
        • Calculate values using the Answer Utilities block
        • Format dates using the Answer Utilities block
        • Increment values using the Answer Utilities block
        • Format and validate text using the Answer Utilities block
        • Search for and replace text using the Answer Utilities block
        • Let chatters upload files using the File Upload block
        • Transfer chatters from one Answer to another using the Redirect block
        • Let chatters advance to other Answers with the Quick Replies block
        • Create scrollable menus using the Carousel block
        • Let chatters select dates using the Date Picker app
        • Generate a chat transcript using the Fetch Chat Metadata block
        • Send emails using the Email app
      • Train and manage Answers
      • Create conversations
      • Personalize conversations
      • Change your bot's look and feel
      • Test your bot
      • Manage your bot and your team
      • Understand the settings chatters can control
      • Create phone conversations with Voice
    • Integrate Ada with other tools
    • Use Ada with your website
    • Measure success
Login
LogoLogo
On this page
  • Overview
  • Available operations
  • Configure the Calculate action
Build and maintain your botWork with blocks and apps

Calculate values using the Answer Utilities block

Previous

Format dates using the Answer Utilities block

Next
Built with

Overview

Use the Calculate action to perform basic math operations. You can calculate static values added when you set up the action, or dynamic values captured in variables. The result of the calculation is always captured in a variable.

Available operations

  • Addition (+)

  • Subtraction (-)

  • Multiplication (*)

  • Division (/)

  • Exponentiation (^)

  • Use parentheses () to modify the order of operations.

Configure the Calculate action

  1. Click the Select Action drop-down menu and select Calculate. The Expression input field appears.

  2. Add an equation to the Expression field. You can use static numbers or variables exclusively or in combination.

  3. To determine the number of decimal places to round the result to, click the Select Optional Inputs drop-down menu and select Precision.

    • Use an integer to specify the number of decimal places.

      Example: Entering 5 rounds the calculation result to five decimal places. 0 rounds to the nearest integer (no decimal places).

    • If no precision is set, the result is not rounded and all decimal places are shown.

  4. Click the Save Response as Variable drop-down menu and select Calculated Answer.

  5. Select an existing variable or create a new variable to capture the result of the calculation.

  6. Click the Fallback Answer drop-down menu and select an Answer to display if an error occurs during the block’s operation.

  7. Click Save.

The Calculated Answer variable can now be used in other Answer messaging or processes as required.


Have any questions? Contact your Ada team, or email us at help@ada.cx.