## How to create formulas in Plecto using AI

Use our **AI Formula Assistant (Beta)** to create and edit formulas in Plecto. We're training our own GPT model that can hopefully make your work with formulas in Plecto easier.

How to create a formula with the AI Formula Assistant:

Go to

**Formulas**>**New formula with GPT**.If you have a lot of data in your organization, you might be required to specify the data sources from which Plecto will generate your formulas.

Write your prompt in natural, spoken language. For example:

*"Count the number of booked meetings from Hubspot Meetings"*or*"I want to see the value of won deals from Pipedrive"*.

You can ask the AI Assistant to work with all the available formula functions and data sources. See prompt examples below.Once you're ready, click

**Create**. Plecto will generate and save the formula.(Optional) Check and adjust the formula (verify the data source, function, date field, filters, and others). Save to finish.

## Edit your formula with AI

You can edit your formulas using the AI Formula Assistant (Beta).

Open your formula.

Click

**Modify with GPT**.For now, the AI Assistant doesn't remember which data sources you used (if you were asked to specify), so you'll have to select them again.

Write your prompt. Here, you can ask GPT to edit the formula, for example:

*"Change the formula to count the number of won deals instead."*Click

**Modify**. Plecto will generate the formula.__The changes won't be saved yet!__Click

**Save**to apply changes.

## How to write a formula prompt ✨

Here are some example prompts you could use with the AI Formula Assistant:

I want to see how many qualified Salesforce opportunities there are

Show the latest agent availability status from Aircall

Count the number of emails sent

Count the number of missed calls last month

Give me the average value of closed deals based on the close date

Calculate how many calls are made on a workday on average

Make an

**IF statement**where if the closed deal value is greater than 2000 you show "true", but if it's less than 2000, show "false"Calculate the sales conversion rate for Salesforce Opportunities

## Known limitations of the AI Formula Assistant

All formula outputs are currently Decimal number. If you ask for the latest status, average value, percentages, you'll have to update the

*Number format*yourself before saving the formula.It's currently not possible to revert changes in case you've saved new versions of the formula.

Some typos are okay, but try to spell your prompts correctly to help the AI Assistant understand what you mean.

If the AI Assistant generates a formula, but throws an error in the Visual Editor, try to switch to the Advanced editor where you'll be able to see the erroneous formula written out.