Skip to main content

Automatically send Opportunity feedback from Salesforce to Harvestr

Send win/loss feedback from Salesforce Opportunities to Harvestr automatically, with a Salesforce Flow or with Zapier.

Written by Marina Salmon

Opportunities in Salesforce often contain valuable product feedback, whether it’s a Closed Lost reason, a sales objection, or a custom field filled out by sales reps.

You can automatically push this feedback into Harvestr to centralize insights from your sales pipeline, analyze product gaps, and inform prioritization.

This guide explains how to do this using:

Example scenario

We’ll use Closed Lost reasons as an example throughout this guide, but the same logic applies to any Opportunity property where sales reps capture product-related insights (e.g. objection fields, feature requests, internal notes).

Option 1: Using Zapier

Prerequisites

  • Salesforce and Harvestr accounts connected to Zapier. The first time you connect Harvestr, Zapier asks for your Harvestr login token: copy it from the Login token card of Settings > Integrations > Zapier (click Generate login token if there is none yet)

  • A field in Salesforce (e.g. Lost Reason) where feedback is collected

Steps

  1. Trigger: Salesforce → Updated Field on Record

    • App: Salesforce

    • Event: Updated Field on Record

    • Object: Opportunity

    • Filters:

      • Stage = Closed Lost

      • Lost Reason (or any feedback field) is not empty

  2. Action: Harvestr → Create Message

    • App: Harvestr

    • Event: Create Message

    • Set up the action with:

      • Title: type Lost Opportunity - , then map the Opportunity's Account Name field

      • Content: map the Opportunity's Lost Reason field (or your feedback field)

      • Channel: SALESFORCE

      • Requester Email: map the email of the Opportunity's Contact (the customer who gave the feedback)

      • Submitter Email: map the email of the Opportunity Owner (the sales rep who reported it)

      • (Optional) Add labels like lost-deal, sales-feedback

  3. Test your Zap

    • Update a test Opportunity in Salesforce

    • Confirm that the feedback appears in your Harvestr inbox


Option 2: Using Salesforce Flow + Harvestr API

If your team prefers to automate workflows directly within Salesforce without using third-party tools like Zapier, you can send Opportunity feedback to Harvestr using a Record-Triggered Flow and an HTTP callout.

This method gives you full flexibility to customize when and how feedback is pushed, and can be deployed across multiple fields or Opportunity stages.

Prerequisites

  • Admin access in Salesforce

  • A Harvestr access token with Create access on Feedback, created in Settings > Integrations > Public API. Editors and Owners can create tokens

  • An External Credential and a Named Credential in Salesforce to authenticate the callout securely

  • A custom Flow (created with Flow Builder)

Note on Salesforce Named Credentials

Since Winter ’23, Salesforce splits authenticated callouts into two objects: an External Credential (stores the auth protocol, principal, and headers) and a Named Credential (stores the endpoint URL and references an External Credential). This guide uses that model.

Steps

Step 1: Create a Harvestr access token

Harvestr uses a private-app token passed in a custom header (X-Harvestr-Private-App-Token), not a standard Bearer token.

  1. Go to Settings > Integrations > Public API and click Create token.

  2. In Name, enter something like Salesforce Opportunity feedback.

  3. Under Access, select Create on the Feedback row (required for the POST /v1/message endpoint).

  4. Click Create token, copy the token from Copy your token now to a password manager, then click Done. You won't see it again.

Harvestr docs: Quickstart and Required scopes

Step 2: Create an External Credential in Salesforce

The External Credential holds the Harvestr API token and injects it as a custom HTTP header on every callout.

  1. Go to Setup > Security > Named Credentials and open the External Credentials tab.

  2. Click New. Fill in:

    • Label: Harvestr

    • Name: Harvestr

    • Authentication Protocol: Custom

  3. Save.

  4. In the Principals section, click New. Fill in:

    • Parameter Name: Default

    • Sequence Number: 1

    • Identity Type: Named Principal

    • In Authentication Parameters, add:
      ​Name: token
      ​Value: paste your Harvestr access token

  5. Save.

  6. Back on the External Credential page, in the Custom Headers section, click New. Add:

    • Name: X-Harvestr-Private-App-Token

    • Value: {!$Credential.Harvestr.token}

    • Sequence Number: 1

  7. Save.

  8. In your Salesforce Permission Sets, grant access to this External Credential to the users or integration principal that will run the Flow.

Step 3: Create a Named Credential

The Named Credential holds the Harvestr API base URL and points to the External Credential you just created.

  1. In Setup > Security > Named Credentials, open the Named Credentials tab.

  2. Click New. Fill in:

    • Label: Harvestr API

    • Name: Harvestr_API

    • URL: https://rest.harvestr.io

    • External Credential: Harvestr

    • Generate Authorization Header: unchecked (Harvestr uses a custom header, not Authorization: Bearer)

    • Allow Formulas in HTTP Body: you can leave it unchecked. This setting only lets Apex code use credential fields in a request body. The Flow sets the body from record fields in Step 6.

  3. Save.

Step 4: Create a Record-Triggered Flow

Build a Flow that fires when an Opportunity is updated (e.g., marked as Closed Lost and a feedback field is filled).

  1. Go to Setup > Flows.

  2. Click New Flow.

  3. Select Record-Triggered Flow.

  4. Object: Opportunity.

  5. Trigger the Flow When a record is updated.

  6. Entry Conditions (example):

    • StageName Equals Closed Lost

    • Lost_Reason__c Is Null = False

  7. Optimize for: Actions and Related Records.

  8. On the Start element, turn on Add Asynchronous Path. This creates a Run Asynchronously path. You add the HTTP callout to this path in Step 6, not to the immediate path.

Why an asynchronous path?

Salesforce blocks callouts to external services while a record is being saved, so a record-triggered flow that calls Harvestr on its immediate path fails. The asynchronous path runs in the background after the Opportunity save is committed, which allows the callout. Asynchronous paths don't support the ISCHANGED operator.

Step 5: Capture the customer's identity

The Harvestr POST /v1/message endpoint requires a requester object with a type (USER or COMPANY) and a name. For type USER, you can also provide an email. If the requester doesn't exist in Harvestr yet, they will be created (upserted).

Make sure you have Salesforce fields you can map to those values, such as:

  • A Contact lookup on the Opportunity, or a formula field that pulls Contact.Name and Contact.Email

  • Or an Account-level field if you want to attach the feedback to a company instead of a person

Step 6: Add an HTTP Callout to Harvestr

Use the Named Credential to POST the feedback to Harvestr. Add every element in this step to the Run Asynchronously path.

Create the HTTP Callout action

  1. On the Run Asynchronously path, click +, select Action, then click Create HTTP Callout.

  2. Configure the external service:

    • Name: Harvestr

    • Named Credential: Harvestr_API (Salesforce fills in the URL)

  3. Click Next and configure the action:

    • Label: Send Feedback to Harvestr

    • Method: POST

    • URL Path: /v1/message

  4. Provide a sample request body: click New and paste a sample JSON request with example values (see below). Salesforce generates a data structure (an Apex class) from this sample. Click Review, then Done.

  5. Provide a sample response body the same way, for example the response shown in the Harvestr API reference. Click Review, then Done.

  6. Click Save. Flow Builder creates the action and the external service.

Sample request body (example values only, this is the shape Harvestr expects):

{  "title": "Lost Opportunity - Acme Corp",  "content": "Missing SSO integration",  "channel": "SALESFORCE",  "requester": {    "type": "USER",    "name": "Jane Doe",    "email": "[email protected]"  },  "submitter": {    "name": "John Smith",    "email": "[email protected]"  }}

Don't type record fields into the sample

The sample request is only used to generate the data structure. The actual values come from the Opportunity, which you set with an Assignment element below.

Set the request body from the Opportunity

  1. In the HTTP Callout action, for body, select New Resource and enter an API name such as harvestrMessage. The data type and Apex class are set for you, which creates an Apex-defined variable.

  2. Before the HTTP Callout action, on the same Run Asynchronously path, add an Assignment element.

  3. In the Assignment, set each field of harvestrMessage from the triggering record (replace with your actual field names), for example:

    • title: a text formula or text template such as Lost Opportunity - {!$Record.Account.Name}

    • content: {!$Record.Lost_Reason__c}

    • channel: SALESFORCE

    • requester: type USER, name {!$Record.Contact.Name}, email {!$Record.Contact.Email}

    • submitter: name {!$Record.Owner.Name}, email {!$Record.Owner.Email}

  4. Make sure the HTTP Callout action uses harvestrMessage as its body input.

What you don't need to configure

Base URL: handled by the Named Credential (https://rest.harvestr.io). You only set the path (/v1/message).

Auth header: injected automatically from the External Credential's Custom Headers. Do not add X-Harvestr-Private-App-Token manually.

Content-Type header: Salesforce sets application/json automatically when you provide a JSON body.

Reference: the full request/response schema for POST /v1/message is documented at developers.harvestr.io/api/create-a-message. Optional fields include labels, integrationId, and integrationUrl.

Step 7: Activate and test the Flow

Salesforce docs: Activate a Flow

  1. Save and activate your Flow.

  2. Update an Opportunity in Salesforce that meets the conditions.

  3. Confirm the feedback appears in your Harvestr inbox. Because the callout runs on the asynchronous path, it can take a short moment.

  4. If the callout fails, check Setup > Flow Interviews for the failed run and inspect the HTTP response body for the error returned by Harvestr.

Tie feedback to revenue

Once your Salesforce Opportunity feedback is flowing into Harvestr, you can unlock even more value by activating our Salesforce customer data sync. It automatically enriches feedback with revenue data like ARR or deal size, so you can prioritize based on business impact.

Did this answer your question?