This guide outlines the steps to build a Record-Triggered Flow in Salesforce that creates an Opportunity when Conversica marks a Lead or a Contact as a Hot Lead. When Conversica flags a record as a Hot Lead, it checks the Salesforce field AVA__AVAAI_hot_lead__c (label: Conversica Hot Lead), and this flow uses that field as its trigger.
Flow Type: Record-Triggered Flow Status: Inactive (requires manual activation after setup)
Note: Classic Workflow Rules cannot create records. They are limited to field updates, tasks, emails, and outbound messages. To create an Opportunity, use a Record-Triggered Flow, which is Salesforce's recommended automation tool. Process Builder also works, but it is being retired and should not be used for new automation.
Table of Contents
Before You Begin
If Your Org Uses Person Accounts
Step 1: Create the Flow
Step 2: Create the Formula Resources
Step 3: Configure the Start Element
Step 4: Add a Create Records Element
Step 5: Save and Activate
Step 6: Test the Flow
Tip: Prevent Duplicate Opportunities
If Your Org Renames Opportunities
Troubleshooting
Resource Summary Table
Flow Logic Summary
The flow runs when a Lead or Contact is created or updated, and the Conversica Hot Lead checkbox becomes checked. For each qualifying record, it creates one Opportunity and maps the Name, Stage, Close Date, Owner, and Account from the triggering record. Records that do not meet the entry conditions do not start the flow at all.
Before You Begin
- Confirm the
AVA__AVAAI_hot_lead__ccheckbox is on the object you want to use. The Conversica package installs it on both Lead and Contact. - Choose one object: Lead or Contact. A Record-Triggered Flow runs on a single object, so if you want this on both, build the same flow twice.
- Check whether your org uses Person Accounts. A flow built on Contact does not run for Person Accounts. See If Your Org Uses Person Accounts.
- Check whether your org already has automation that renames Opportunities, such as a Workflow Rule or another flow. See If Your Org Renames Opportunities.
- Build and test in a Sandbox before deploying to Production.
Note: Opportunities are normally tied to an Account. The Contact object has an Account lookup you can map, but the Lead object does not have one until the Lead is converted. On a Lead-based flow, leave Account ID out or map a custom Account field your org populates.
If Your Org Uses Person Accounts
With Person Accounts, each person is stored as an Account record, and their Contact fields appear on that Account. Edits to a Person Account run automation on the Account object, so a flow built on Contact never runs. Debug can still succeed against the hidden Contact record, which makes this easy to miss.
How to tell: open one of your people in Salesforce and look at the record ID in the browser address bar. An ID beginning with 003 is a Contact. An ID beginning with 001 is an Account, which means you are using Person Accounts.
If you use Person Accounts, build the flow on Account and make these changes as you follow the steps below:
| Setting | Contact flow | Person Account flow |
|---|---|---|
| Object (Step 3) | Contact |
Account |
| Entry conditions (Step 3) |
AVA__AVAAI_hot_lead__c Equals True
|
IsPersonAccount Equals True, and AVA__AVAAI_hot_lead__pc Equals True
|
| Account ID (Step 4) | {!$Record.AccountId} |
{!$Record.Id} |
| Conversica source fields (Step 4) | Fields ending in __c
|
Fields ending in __pc
|
Contact fields appear on a Person Account with the suffix __pc instead of __c. In the field picker, search by the label (for example Conversica Hot Lead) and choose the field whose API name ends in __pc.
For Account ID, choose Triggering Account → Account ID, which is the record's own ID. Do not choose Parent Account ID. That is a different field and is usually blank.
Step 1: Create the Flow
- Navigate to Setup → Process Automation → Flows and click New Flow.
- Select Record-Triggered Flow as the flow type and click Create.
- Once in Flow Builder, click the flow title and name it. For this guide, we'll use:
Conversica Flow | Create Opportunity From Hot Lead - Set the API Name to auto-populate or set it manually as appropriate.
Step 2: Create the Formula Resources
This flow uses two formula resources: one for the Opportunity Close Date, and one for the Opportunity Name.
Close Date: CloseDateThirtyDays
Purpose: Opportunity requires a Close Date. This formula sets it to 30 days from the day the flow runs.
- In Flow Builder, click Toggle Toolbox to open the Manager panel, then click New Resource.
- Set Resource Type to
Formula. - Enter the API Name:
CloseDateThirtyDays. - Set Data Type to
Date. - In the Formula field, enter:
TODAY() + 30 - Click Done. Adjust the number of days to match your sales cycle.
Opportunity Name: OpportunityName
Purpose: Builds the Opportunity name from the triggering record. A formula is needed because the Set Field Values box in Step 4 holds a single resource. When you choose a field from the resource picker, it replaces any text already in the box, so you cannot combine a field and literal text there.
- Click New Resource again.
- Set Resource Type to
Formula. - Enter the API Name:
OpportunityName. - Set Data Type to
Text. - In the Formula field, enter:
LEFT(TRIM({!$Record.FirstName} & " " & {!$Record.LastName}) & " - Conversica Hot Lead Opportunity", 120)
- Click Check Syntax, then Done.
Why First Name and Last Name: The full Name field on Leads and Contacts is a compound field and can come through blank inside flow formulas. Building the name from FirstName and LastName avoids that, and TRIM removes the extra space when a record has no First Name.
Important: Opportunity Name is limited to 120 characters, and the Create Records element fails if the formula returns more than that. The LEFT(..., 120) wrapper prevents that failure.
Matching Your Own Naming Convention
Because the name is a formula, you can reproduce your existing convention. Common building blocks:
| Convention | Formula |
|---|---|
| Company first (Lead) | {!$Record.Company} & " - New Business" |
| Account first (Contact) | {!$Record.Account.Name} & " - New Business" |
| Date-stamped | TRIM({!$Record.FirstName} & " " & {!$Record.LastName}) & " - " & TEXT(TODAY()) |
| Conversica attribution | TRIM({!$Record.FirstName} & " " & {!$Record.LastName}) & " - " & {!$Record.AVA__AVAAI_conversation__c} |
The company name lives in a different place on each object: Company on Lead, and {!$Record.Account.Name} on Contact. If you build this flow on both objects, the two formulas will differ. If your org already renames Opportunities automatically, read If Your Org Renames Opportunities before choosing a convention here.
Step 3: Configure the Start Element
Click the Start element and configure the following:
- Object:
LeadorContact - Trigger the Flow When: A record is created or updated
- Condition Requirements: All Conditions Are Met (AND)
- Filter Condition:
○ Field: AVA__AVAAI_hot_lead__c | Operator: Equals | Value: True (Checked)
- When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements
- Optimize the Flow For: Actions and Related Records
The last two settings matter. Only when a record is updated to meet the condition requirements makes the flow run on the change from unchecked to checked, so it does not create another Opportunity every time the record is saved afterward. Actions and Related Records is required because the flow creates a record, which a fast field update flow cannot do.
For Person Accounts, set Object to Account and use the two conditions from If Your Org Uses Person Accounts instead.
Step 4: Add a Create Records Element
After the Start element, add a Create Records element.
- Label:
Create Hot Lead Opportunity - API Name:
Create_Hot_Lead_Opportunity - How to Set Record Field Values: Manually
- Object:
Opportunity
Set Field Values for the Opportunity:
| Field | Value |
|---|---|
| Opportunity Name |
{!OpportunityName} (the Text formula from Step 2) |
| Stage |
Prospecting (or the first stage in your sales process) |
| Close Date |
{!CloseDateThirtyDays} (the formula from Step 2) |
| Owner ID | {!$Record.OwnerId} |
| Account ID | Contact flow: {!$Record.AccountId}Person Account flow: {!$Record.Id}Lead flow: leave this row out |
| Record Type ID | Only if your org uses Opportunity record types: the ID of the record type, which begins with 012
|
Every row needs a value. A row with an empty Value box is not skipped. It writes a blank value, which causes errors such as owner cannot be blank. Delete any row you do not need with the trash icon.
Record Type ID: If your org uses Opportunity record types, set this so every Conversica Opportunity gets the right one. Otherwise Salesforce uses the default record type of the user who triggered the flow, which is usually the Conversica integration user. Enter the ID, not the name. To find it, go to Setup → Object Manager → Opportunity → Record Types, click the record type, and copy the ID beginning with 012 from the browser address bar.
Choosing Values in the Resource Picker
- The triggering record appears under its object name, such as Triggering Contact or Triggering Account. This is the same as
$Record. - To choose one of its fields, click the > arrow at the right of Triggering Contact, not the name itself.
- Choose fields with the plain Aa icon. Entries with a > arrow, such as Owner or Parent Account ID, open a related record instead.
- Do not use Prior Values of Triggering Contact. It holds the record's values from before the save.
- You can also type a reference directly, such as
{!$Record.OwnerId}, then click outside the box. A valid reference turns into a blue pill.
About Owner ID
Map Owner ID to {!$Record.OwnerId} so the Opportunity belongs to the same rep as the Lead or Contact. If you leave Owner ID out, Salesforce assigns the Opportunity to the user who triggered the flow, which is usually the Conversica integration user.
Lead flows only: Leads can be owned by a queue, but Opportunities cannot. If your Leads are sometimes queue-owned, create a Text formula resource named OpportunityOwnerId with the formula below, replace 005XXXXXXXXXXXXXXX with the ID of a user who should receive those Opportunities, and map Owner ID to {!OpportunityOwnerId}.
IF(BEGINS({!$Record.OwnerId}, "005"), {!$Record.OwnerId}, "005XXXXXXXXXXXXXXX")
Recommended: Carry Conversica Fields onto the Opportunity
The Conversica package writes several fields onto the Lead or Contact that explain why the record went Hot. Mapping them onto the Opportunity in this same element lets your team see which Assistant, Contact List, and Conversation produced the deal, and lets you report on Conversica-sourced pipeline without joining back to the Lead or Contact.
The Opportunity object does not have the Conversica fields. The Conversica package installs its AVA__ fields on Lead and Contact only. You are not mapping an AVA__ field to an AVA__ field. You create your own fields on Opportunity and copy the Conversica values into them.
- Go to Setup → Object Manager → Opportunity → Fields & Relationships and click New. Create one Text (255) field for each value you want to carry over, using the names in the New Opportunity Field column below. Use Text fields, not formula fields: a flow cannot write to a formula field.
- Give the relevant profiles or permission sets read access to the new fields, and add them to your Opportunity page layout. Otherwise the values save but nobody can see them.
- In the Create Records element, add one row to Set Field Values for each field: set Field to your new Opportunity field and Value to the matching field on the triggering record. For example, set
Conversica_Assistant__cto{!$Record.AVA__AVAAI_assistant__c}. On a Person Account flow, use the__pcversion of each source field.
| Conversica Field | Source API Name (Lead/Contact) | New Opportunity Field | What It Contains | Example |
|---|---|---|---|---|
| Conversica Assistant | AVA__AVAAI_assistant__c |
Conversica_Assistant__c |
Assistant the record is assigned to | Karine Castillo |
| Conversica Contact List | AVA__AVAAI_contact_list__c |
Conversica_Contact_List__c |
Contact List the record is on | Lapsed FB Season Ticket Winback Karine |
| Conversica Conversation | AVA__AVAAI_conversation__c |
Conversica_Conversation__c |
Conversation the record is engaged with | Fresh Fans: Request Call |
These values are copied at the moment the Opportunity is created and do not update afterward, which is usually what you want for attribution reporting.
Leave Check for Matching Records toggled off, then connect this element to an End element.
Note for Contact flows: Mapping Account ID relates the Opportunity to the Account, but not to the Contact. A Contact's Opportunities list only shows Opportunities where the Contact has a Contact Role, so without one your reps will not see the new Opportunity on the Contact. To add one, add a second Create Records element on the Opportunity Contact Role object, and set Opportunity ID to Opportunity ID from Create Hot Lead Opportunity, Contact ID to {!$Record.Id}, and Is Primary to True. Person Account flows do not need this.
Step 5: Save and Activate
- Click Save. When you edit an existing flow, click Save As New Version.
- Click Activate. A newly saved version is a draft, and the previous version keeps running until you activate the new one.
- When testing in your Sandbox is complete, deploy to Production and activate the flow there.
Only one version of a flow can be active at a time. Activating a new version automatically deactivates the previous one.
Step 6: Test the Flow
Test with Debug
Debug runs the version you have open, shows every value the flow uses, and does not need the flow to be active.
- Click Debug.
- Choose a test record and run the flow as if the record was updated.
- Check Skip start condition requirements. Without it, Debug compares the record to itself, and a record that is already checked is skipped with the message The triggering record didn’t meet the start conditions.
- Check Run flow in rollback mode, if offered, so the test does not create a real Opportunity.
- Click Run and review the Create Records section. Every field should show the value you expect, with no error.
Test with a Real Record
- Make sure the version you want to test is Active.
- On a test record, uncheck Conversica Hot Lead and click Save.
- Check Conversica Hot Lead and click Save again. The flow runs only on this change from unchecked to checked.
- Find the new Opportunity under Opportunities → All Opportunities, sorted by Created Date. It appears on a Contact's Opportunities list only if you added the Contact Role element in Step 4.
- Save the record once more without changes, and confirm no second Opportunity is created.
If the flow fails during a save you make by hand, Salesforce shows an error and does not save the record. When Conversica checks the box, nobody sees that error, so check the error email described in Troubleshooting.
Tip: Prevent Duplicate Opportunities
The entry condition in Step 3 already stops the most common cause of duplicates. If a record can go Hot more than once, for example if the checkbox is cleared and Conversica flags the record again later, add a simple guard:
- Create a checkbox field on your object, for example
Opportunity_Created__c. - Add a Decision element after the Start element with one outcome,
No Existing Opportunity, whose condition isOpportunity_Created__cEqualsFalse. Connect that outcome to your Create Records element and the default outcome to an End element. - After the Create Records element, add an Update Records element that sets
Opportunity_Created__ctoTrueon the record that triggered the flow.
The Update Records element is what makes the guard work. Without it the checkbox is never set, and the Decision element always allows a new Opportunity through.
If Your Org Renames Opportunities
Some orgs have a Workflow Rule, flow, or trigger that rebuilds every Opportunity Name from other fields. That automation runs after this flow creates the Opportunity. If the fields it uses are empty, it can produce a blank name, and Salesforce rejects the record with REQUIRED_FIELD_MISSING: [Name] even though this flow sent a valid name.
There are two ways to handle this:
- Let your automation name the Opportunity. In Step 4, also set every field your automation uses to build the name, plus the record type it filters on.
-
Have your automation skip Conversica Opportunities. Create a checkbox on Opportunity, for example
Created_by_Conversica__c, with a default value of Unchecked. Set it toTruein Step 4, and have your naming automation check it.
For a Workflow Rule, the safest place to check the box is inside the Name field update formula, so the rule's other field updates keep running:
IF(Created_by_Conversica__c, Name, <your existing naming formula>)
If you add the checkbox to the rule's criteria instead, the whole rule is skipped for Conversica Opportunities, including any other field updates it performs. Either way, make sure the checkbox defaults to Unchecked. If it defaults to Checked, every Opportunity in your org is treated as a Conversica Opportunity.
Troubleshooting
When a flow fails, Salesforce emails the error, titled Error Occurred During Flow Execution, to the user who last modified the flow. You can change the recipient in Setup → Process Automation Settings. Failed runs are also listed in Setup → Paused and Failed Flow Interviews.
| Symptom or Error | Likely Cause | Fix |
|---|---|---|
| No Opportunity is created and no error appears | The flow is not active, the box was already checked before the save, or your org uses Person Accounts | Activate the latest version, then uncheck, save, check, and save again. See If Your Org Uses Person Accounts |
| Debug says The triggering record didn’t meet the start conditions | The box was already checked before the update | In Debug, check Skip start condition requirements |
REQUIRED_FIELD_MISSING: [Name] |
The name is blank, or other automation is blanking it | Use the OpportunityName formula from Step 2. See If Your Org Renames Opportunities
|
INVALID_CROSS_REFERENCE_KEY: Owner ID: owner cannot be blank |
The Owner ID row is empty or maps a blank field | Map Owner ID to {!$Record.OwnerId}
|
| Invalid reference to "$Record.AccountId" | The flow is on Account (Person Accounts) | Map Account ID to {!$Record.Id}
|
| bad value for restricted picklist field | A value is not allowed for the record type, or does not match a dependent picklist | Choose values from the picklist, and set Record Type ID |
STRING_TOO_LONG |
The Opportunity name is over 120 characters | Wrap the name formula in LEFT(..., 120)
|
FIELD_CUSTOM_VALIDATION_EXCEPTION |
A validation rule on Opportunity blocked the record | Read the rule message in the error and set the field it requires |
| Two Opportunities for one record | When to Run is set to every update | Set it to Only when a record is updated to meet the condition requirements |
| A field is missing from the Create Records field list | It is a formula field | Use a Text field instead. A flow cannot write to a formula field |
Resource Summary Table
| Variable | Type | Created By | Purpose |
|---|---|---|---|
| CloseDateThirtyDays | Formula (Date) | Manually via New Resource | Sets the Opportunity Close Date to 30 days out |
| OpportunityName | Formula (Text) | Manually via New Resource | Builds the Opportunity Name from First Name and Last Name |
| Triggering Lead / Contact / Account | Record (Single) Variable | Auto-generated by the Start element | Holds the record that fired the flow; supplies the name, Owner, Account, and Conversica fields |
| Opportunity from Create Hot Lead Opportunity | Variable | Auto-generated | Stores the ID of the new Opportunity for later elements, such as the Contact Role element |
Comments
0 comments
Please sign in to leave a comment.