AI Calculations

Introduction

The AI Calculations feature is an agile tool designed to streamline your forms. We've combined the robust capabilities of the Calculation field with AI, creating a powerful solution that's efficient and intelligent. Say goodbye to manual calculation setups and hello to smarter, quicker, and more effective forms.

At first glance, you'll notice the Calculation field consists of several sections thoughtfully organized to help you easily configure and display your desired results.

The Calculation input field is where your calculation is executed. Here, you can manually enter or update your calculation formula. Additionally, when you use the AI Calculations feature, this field will display and run the final version of your calculation and apply the results to your form.

Highlight of the Calculation Input field within the Calculation Field Type.

The How to Use tab opens a window displaying all available syntax options for the Calculation field. Here, you'll find explanations of each syntax, their functions, and examples demonstrating how they can be implemented within your form.

Highlight of the "How to use" tab within the Calculation Field.
Elements within the "How to use" window.

The AI Calculation prompt input field is where you can enter instructions or prompts to guide the AI in creating and executing calculations for your form.

Highlight of the AI prompt field with the Calculation Field Type.

Prompting the AI

Examples

You can think of prompting as providing clear instructions or guidelines to help the AI understand exactly what you're aiming for. By carefully wording your prompts, you're guiding the AI toward generating accurate calculations and results tailored specifically to your needs.

If you are using the Calculation Field to extract a smaller set of data, using a concise prompt may be enough to provide the desired output.

The following examples will provide some insight on how prompts will instruct the AI to extract the desired information using the Calculation field.

Example 1: Split First and Last Name

Use the prompt “Extract only the first name from the Your Name question.” and click Send.

AI Calculations prompt field with a simple prompt.

After the prompt has finished processing, three new sections will appear above the prompt field:

  • The top section displays the actual calculation, along with explanatory notes marked by double slashes (//) to briefly describe each part of the calculation.
  • The middle section, highlighted in gold, provides an example demonstrating what the calculation will output.
  • The bottom section, located below the results section, outlines the steps the AI took to create the calculation.

Finally, the Apply button lets you confirm the calculation, automatically transferring it into the Calculation input field.

View of the AI generated calculation, result, and processes.

In this example, the calculation field is only extracting and outputting the First Name from a field on the form.

View of the applied calculation and AI Calculations modal to extract the First Name.

To extract only the Last Name into a Calculation field, follow these steps:

  • Duplicate the existing First Name calculation question.

  • Rename the duplicated field to Last Name.

  • Enter the following prompt into the AI Calculation prompt field:

    “Modify this calculation to extract only the last name from the Your Name question.”

  • Click Send to process the prompt.

  • Once the AI generates the updated calculation, click the Apply button to accept the changes.

  • Review the updated calculation, now correctly configured to display just the last name.

View of the applied calculation and AI Calculations modal to extract the Last Name.

Now that you have two Calculation fields where one outputs the First Name and the other outputs the Last Name of the respondent, we can run a test to make sure that the AI-generated Calculation is what we were looking to achieve.

Make sure to go into the Question Panel for both of the Calculation fields and disable the Hide this question option. This will ensure that the Calculation field is visible on the Preview or Published version of the form.

Highlight of the "Hide this question" option in the OFF position.

Lastly, test your setup, open the form in Preview or Published mode and enter a full name (e.g., John Smith) into the Your Name text input. Then, verify that:

  • The First Name calculation field correctly displays John.
  • The Last Name calculation field correctly displays Smith.

This ensures both calculations are functioning as expected based on the full name input.

Example of the Text field with values with the Calculation fields displaying the First and Last name.

Example 2: show error for free email domains

Step 1. Create a new calculation question with the title Block common free email providers directly under your email question field.

Step 2. Enter a prompt to display an error message and prevent form submission when a free email provider is used.

Prompt for AI Calculations to display an error when using a free email domain.

Step 3. Click the down arrows to view either the complete calculation or explanation.

Highlighted buttons to show more of the AI-generated calculation and the steps taken by the AI to generate the calculation.

Step 4: Click the Apply button to accept the calculation and move it to your calculation input panel.

Image of the applied AI-generated calculation in the Calculation field.

Step 5. Publish and test your live form with Gmail, Hotmail, and business domain email addresses.

Image of the AI-generated calculation that displays an error message when a free email domain is used.

Example 3: Subtract 10% discount if purchasing more than 2 products

Step 1. Create a new calculation question with the title Multiple Product Discount under the Pottery Classes product question.

Step 2. Use a prompt to instruct the AI to generate a calculation that applies a 10% discount.

Prompt for the AI to generate a calculation to apply a 10% discount if more than 2 total products are selected.

Step 3. Click the Apply button to accept the suggested AI calculation.

AI Calculation field with the applied AI-generated calculation.

Step 4. Subtract the result from the overall total in Custom Pricing Rules if it is greater than 0.

Applying logic to the Custom Pricing Rules to use the Calculation field to the form's total.

Step 5. Publish and test on your live form.

Test 1 with only 2 products, no discount

No discount added from the Calculation field due to only selecting 2 items.

Test 2 with 3 of the same items, 10% discount applied

10% discount added from the Calculation field due to selecting 3 of the same item.

Test 3 with 3 different items, 10% discount applied

10% discount added from the Calculation field due to selecting 3 separate items.

Gotchas

  • If you're not getting the results you expected, try rephrasing or clarifying your prompt. The AI relies on the information you provide to generate accurate and relevant calculations, so even small changes in wording can lead to better outcomes. Be as specific and descriptive as possible about what you're trying to achieve.
  • While the tool can help generate and apply calculation logic quickly, it may not always produce perfect or fully optimized results, especially in more complex or highly specific use cases. You should still review, test, and adjust the output as needed to ensure accuracy and alignment with their form goals.