Skip to main content

Pre-fill fields from Salesforce via SOQL bot

Use the altaFlow Pre-fill from Salesforce via SOQL bot to run a query, find a matching record, and auto-fill document fields with Salesforce data.

This is a paid bot, and its usage counts toward your plan's credit limits. For more on credit usage, see Credits.

The Pre-fill fields from Salesforce via SOQL bot automatically transfers data from Salesforce records to your altaFlow documents using SOQL queries. The bot runs a query against your Salesforce org, finds the matching record, and pre-fills the mapped document fields with its data.

Example: When generating a sales contract or a quote, this bot retrieves the customer's company name, address, and contact details from Salesforce and pre-fills the document — no manual copying, no typos.

How to set up the bot

To add the bot:

  1. In the step settings, click Add bot or the All bots icon in the bottom-right corner.

  2. Choose Bot and search for Pre-fill fields from Salesforce via SOQL.

  3. Click the bot to install it.

Adding the Pre-fill fields from Salesforce via SOQL bot to a workflow step

Connection settings

To connect the bot to your Salesforce account, click Connect in the Connection settings section.

Connection settings section with the Connect button for Salesforce

To add a new connection, choose a Salesforce instance (Production, Sandbox, or custom domain) and click Apply.

Salesforce instance selector with Production, Sandbox, and custom domain options

Use the three-dot menu to disconnect the current account or switch to a different one at any time.

Three-dot menu to disconnect or switch Salesforce accounts

Mapping

Enter the SOQL query the bot will use to find the record and retrieve data from it. A query follows the standard SOQL structure:

Select <Salesforce fields to retrieve> from <object> where <field> = <value>

For example, to retrieve a phone number by account name:

select phone from account where name = data variable or your value
SOQL query field in the bot mapping section

Use data variables to help the bot find the right record.

Data variables picker with Date and time, Document fields, Package, Signer details, and Workflow options

The variables include:

  • Date and time — indicate a period of time

  • Document fields — select a field in your document

  • Package — package-related data

  • Signer details — signer's name or email

  • Workflow — workflow name

Add as many queries as you need by clicking Add another SOQL query.

Then map Salesforce fields to document fields — pick the Salesforce field that supplies the value and the corresponding document field that receives it.

Field mapping between Salesforce and altaFlow document fields

Conditions

Set conditions to control when the SOQL bot fires so it only runs for the deals that need enrichment. Common scenarios:

  • Enterprise deals only — run the query when the contract value or Salesforce Opportunity Amount is above a threshold, so smaller deals skip the Salesforce lookup.

  • Region-based routing — trigger the query when the Region field equals a specific value (e.g., US or EMEA), so each region pulls from the correct Salesforce dataset.

  • Account type filter — run only for B2B or Partner accounts, keeping consumer records out of a contract template built for businesses.

  • Assigned owner check — fire only when the Salesforce Account Owner or Opportunity Owner matches the current signer, so account managers see their own accounts pre-filled.

For the full list of operators, see Bot conditions and operators.

Advanced settings

Fine-tune how the SOQL bot behaves at runtime:

  • Run once vs. on every step — pull Salesforce data at the start step only, or refresh it on every step so late-stage documents pick up account changes.

  • Failure handling — decide whether to cancel the revision (recommended when Salesforce data is required for compliance) or continue with blank fields (safer for optional enrichment).

  • Salesforce-based tagging — auto-tag the document with the Salesforce Account name or Opportunity ID so revenue ops can filter workflows by CRM record later.

Learn more about Advanced settings in the bot setup glossary.

Did this answer your question?