Go to zenloop

Support Centre

Search for any help questions or topics.

Setting Up Salesforce with zensurveys

Here's how to connect your Salesforce org to zensurveys and set up your first workflow.
Avatar
Virna Harri
Updated 2 hours ago

What You'll Need

  • A Salesforce Professional, Enterprise, Unlimited, or Developer edition with API access enabled (Professional edition requires the API access add-on, purchased separately)

  • Admin permissions in Salesforce (Manage Connected Apps, API Enabled, Customize Application)

  • An active zenloop account with at least one published zensurvey


Step 1: Create a Connected App in Salesforce

This gives zensurveys permission to create Cases in your Salesforce org.

  1. In Salesforce, go to Setup → Apps → App Manager

  2. Click New Connected App

  3. Fill in:

    • Connected App Name: zensurveys

    • API Name: zensurveys

    • Contact Email: your admin email

  4. Under API (Enable OAuth Settings):

    • Check Enable OAuth Settings

    • Callback URL: https://app.zensurveys.com/auth/salesforce/callback

    • Selected OAuth Scopes: Add Access and manage your data (api) and Perform requests at any time (refresh_token, offline_access)

    • Check Require Proof Key for Code Exchange (PKCE)

  5. Click Save

Note: Salesforce takes up to 10 minutes to activate your Connected App. Wait before proceeding.

  1. After activation, go to Manage Connected Apps → zensurveys and note your Client ID and Client Secret


Step 2: Create a Salesforce Workflow in zensurveys

  1. Open your survey in zensurveys

  2. Go to the Workflows tab

  3. Click Create Workflow

  4. Enter a name (e.g., "Detractor Alerts to Salesforce")

  5. Select Salesforce as the channel

  1. Enter the Client ID and Client Secret from Step 1

  2. Click Connect to Salesforce

A popup window opens. Log in with your Salesforce credentials and grant zensurveys access. The window closes automatically when connected.


Step 3: Map Survey Questions to Case Fields

Once connected, zensurveys loads your available Salesforce Case fields.

For each survey question, choose which Case field it should populate:

Survey QuestionMaps to Case FieldExample
NPS rating (0–10)PriorityScore 0–6 → High
Open commentDescription"Delivery was late..."
Customer emailContact Emailcustomer@example.com
Product categoryCustom field (Product__c)"Electronics"

Tips:

  • Custom fields must use the API name with __c suffix (e.g., Product_Category__c)

  • Fields you leave unmapped are skipped — no errors

  • If you don't map Subject, Status, Origin, or Priority, zensurveys uses defaults: Subject = "Survey Response – [workflow name]", Status = "New", Origin = "Web", Priority = "Medium"


Step 4: Set Filters (Optional)

Control which responses create Cases. You can filter by:

  • Score: Only detractors (0–6), passives (7–8), or promoters (9–10)

  • Question response: Specific answers to specific questions

  • Response properties: Metadata like region, product, or customer segment

All filters combine with AND logic — every condition must match

Example: "Create a Case only when the score is 0–6 AND the region is EMEA."


Step 5: Activate and Test

  1. Toggle the workflow to Enabled

  2. Submit a test survey response that matches your filters

  3. Check Salesforce for the new Case

  4. Verify that mapped fields populated correctly


How It Works Behind the Scenes

When someone submits a survey response:

  1. zensurveys evaluates your workflow filters

  2. If filters match, it maps the response data to your configured Case fields

  3. A Case is created in Salesforce via the REST API

  4. Access tokens refresh automatically — no need to re-authenticate

Data flows one direction only: zensurveys → Salesforce. There is no sync from Salesforce back to zensurveys.


Using Salesforce Sandbox

If you want to test before going live with production data:

  1. Create your Connected App in your Sandbox org (not production)

  2. Use the sandbox credentials (Client ID + Secret) in zensurveys

  3. The OAuth flow will authenticate against test.salesforce.com instead of login.salesforce.com

Important: Sandbox mode applies globally to your entire zensurveys instance — you can't run sandbox and production Salesforce connections simultaneously. Contact your zensurveys admin to switch between environments.


Troubleshooting

ProblemLikely CauseFix
"Invalid client" error during connectionConnected App not yet activeWait 10+ minutes after creating the app
OAuth popup shows errorToken expired or revokedClick Disconnect, then reconnect
Case not created after responseWorkflow filters don't matchReview filter conditions; submit a response that matches
Custom field not populatingWrong API nameConfirm the exact API name in Salesforce (case-sensitive, must end in __c)
Validation error from SalesforceCase violates a Salesforce validation ruleCheck your Salesforce validation rules; adjust field mappings or rule logic

Supported Case Fields

zensurveys can populate any writeable Case field, including:

  • Standard fields: Subject, Description, Status, Origin, Priority, Type, Reason

  • Custom fields: Any field ending in __c that is writeable (not formula, not auto-number)

  • Lookup fields: AccountId, ContactId (if you pass valid Salesforce IDs)

  • Record Types: Supported via RecordTypeId mapping — useful if your org uses multiple Case record types


FAQ

What happens if Salesforce is temporarily down? zensurveys retries failed requests with increasing wait times. If Salesforce remains unavailable, the error is logged and your team is notified.

Do I need to re-authenticate periodically? No. zensurveys uses refresh tokens that renew automatically. You only need to re-authenticate if someone revokes the token in Salesforce.

Can I create multiple Salesforce workflows for one survey? Yes. You can create separate workflows with different filters — for example, one for detractors routed to Support and one for promoters routed to Marketing.

😞 😐 😃