Write prompts for formula generation

You've already learned the fundamentals of prompt engineering in the previous module, and you now know how to use the auto generate interface. Let's apply those principles specifically to producing formulas. Writing prompts for formulas has some unique considerations because you're asking the AI to generate executable functions that need to work with your specific data structures.

Describe your desired outcome early 

When prompting for formulas, think about the data transformation you need, not the formula functions themselves. You're translating a business requirement into a technical instruction.

For example:

  • "Get the domain from the email address"

  • “Convert the timestamp to YYYY-MM-DD format”

  • "Extract all IP addresses from the text"

  • “Check if the status code equals 200"

🪄Tip

Reference your upstream data structure explicitly 

Unlike general AI prompts, formula prompts work with specific data from your story. The AI has access to your upstream actions, credentials, and resources, so you should reference them directly.

Instead of generic descriptions, point to the actual data:

  • "Extract the first name from get_user.body.full_name"

  • "Get the first item from api_response.body.results array"

  • "Check if any item in fetch_alerts.body has severity equal to 'high'"

If you're working with nested data, describe the path clearly. For example, "Get the email address from the user object inside the data array" helps the AI navigate complex structures.

Use examples for complex transformations 

When your workflow requires a more complex build than a simple extraction or format change, showing an example of the input and desired output is incredibly helpful. This is especially true for text parsing, pattern matching, or multi-step transformations.

Structure your examples clearly, like so:

  • "Extract the ticket number from text like 'Ticket #12345: Issue description' and return just '12345'"

  • “Take a name formatted as 'Last, First' like 'Smith, John' and convert it to 'First Last' like 'John Smith'"

  • "Parse a string like 'Status: Active | Priority: High' and return just the priority value"

The AI can see the pattern you're describing and generate a formula that matches it. This is much more effective than trying to describe the transformation in abstract terms.

Was this lesson helpful?

Built by you,
powered by Tines

Already have an account? Log in.