Skip to content

Send surveys with a Screen Flow

This guide provides a step-by-step walkthrough for sending surveys to contacts using a Salesforce Screen Flow. This specific flow is designed to send surveys to all campaign members within a Salesforce Campaign, with one call to the Send Surveys (nps.today) action. It works for campaigns of up to about 4,000 members; for larger campaigns, see Troubleshooting.

Watch how it looks

Use case flow

Built this flow from an earlier version of the guide?

Earlier versions called the deprecated Request NPS Ratings action once per campaign member, inside a loop. That flow fails after a few dozen members. Rebuild it with the steps below, or see Request NPS Ratings (deprecated) for a way to keep it working until then.

The finished flow

The finished flow


Prerequisites

  • Apex Action: Ensure the Send Surveys (nps.today) action is available in your org. Update the nps.today package to the latest version to get it.
  • nps.today CampaignID: Have your specific Survey/Campaign ID ready.
  • Permissions: You must have Flow Builder and Object Manager access.

Creating the Flow Foundation

  1. Navigate: Go to Setup > Flows and click New Flow.
  2. Select Type: Choose Screen Flow.
  3. The Record ID Variable:
    • Click New Resource in the left sidebar.
    • Resource Type: Variable.
    • API Name: recordId (⚠️ Casing is critical: lowercase 'r', uppercase 'I').
    • Data Type: Text.
    • Availability: Check Available for input.
    • Purpose: This "catches" the Salesforce Campaign ID from the button.

Variable


Finding the Recipients

  1. Add 'Get Records' for the campaign: Click the (+) on the canvas.
    • Label: Get Campaign.
    • Object: Campaign.
    • Condition Requirements: Id Equals recordId.
    • How Many Records: Select Only the first record.
    • Purpose: The campaign owner becomes the responsible employee of every survey.
  2. Add 'Get Records' for the members: Click the (+) after Get Campaign.

    • Label: Get Campaign Members.
    • Object: Campaign Member.
    • Condition Requirements:
      • CampaignId Equals recordId
      • ContactId Is Null False
    • How Many Records: Select All records.
    • Storage: Select Automatically store all fields.

    Get Campaign Members

  3. Collect the contact IDs:

    • Click New Resource: Resource Type Variable, API Name contactIds, Data Type Text, and check Allow multiple values (collection).
    • Click the (+) after Get Campaign Members and add a Loop. Label: Collect Contact Ids. Collection Variable: {!Get_Campaign_Members}.
    • On the For Each Item path, add an Assignment. Label: Add Contact Id. Set {!contactIds} Add {!Collect_Contact_Ids.ContactId}.
    • The loop only collects IDs. Don't add an action inside it.

    Add Contact Id

  4. Add 'Get Records' for the contacts on the After Last path of the loop.

    • Label: Get Contacts.
    • Object: Contact.
    • Condition Requirements: Id In {!contactIds}.
    • How Many Records: Select All records.
    • Storage: Select Automatically store all fields.

    Get Contacts


The Confirmation Screen

  1. Add 'Screen' Element: Click (+) after Get Contacts.
  2. Label: Confirm Survey Send.
  3. Configure Footer:
    • In the right sidebar, expand Configure Footer.
    • Under Next or Finish Button, select Use a custom label.
    • Type: Send Surveys Now.
  4. Add 'Data Table' Component:
    • Drag Data Table from the left components menu onto the screen.
    • Source Collection: Select {!Get_Contacts}.
    • Configure Columns: Add your preferred columns, e.g., Full Name and Email.

When the flow runs, the screen lists the contacts that get a survey:

Confirmation screen


Sending the Surveys

  1. Add 'Action': Click (+) after the Confirmation Screen. Don't put it inside a loop.
  2. Search: Search for survey and select Send Surveys (nps.today).
  3. Label: Send Surveys.
  4. Who gets the survey:
    • Send to: Select Contacts.
    • Records: Keep A record collection and select Records from Get Contacts in the list next to it.
  5. Campaign ID: Keep Fixed value and enter your campaign ID (e.g., 18134).
  6. Responsible employee: Select User ID from the flow. In the list next to it, select Get Campaign, then Owner ID. The setting then shows Get Campaign › Owner ID.
  7. What-Id: Select From the flow, then recordId.

    Send Surveys action

The action sends the surveys in the background, at most 250 respondents per request. See Send surveys from a flow for all its settings, and Stay within Salesforce's limits for how long a list can be.

Let the user choose who gets the survey

Set the data table on the confirmation screen to let the user select rows. The list next to Records then also offers Selected Rows from followed by the name of your table. Choose it, and only the ticked contacts get the survey.


The Result Message

  1. Add 'Screen' Element: Click (+) after Send Surveys.
  2. Label: Result.
  3. Configure Footer:
    • Under Next or Finish Button, select Use a custom label.
    • Type: Done.
  4. Add 'Display Text' Component:

    • Drag Display Text onto the screen.
    • Insert the resource {!Send_Surveys.message}. It shows e.g. Queued 3 rating requests.

    Result screen

  5. Optional: Add a Decision on {!Send_Surveys.success} before the screen, to show a warning when some contacts were skipped. The reasons are logged as NPS Error records.

  6. Save and Activate: Click Save, give the flow a name, e.g. Send NPS Surveys, and click Activate. Only active flows can be chosen for a button.

Deployment (The Button)

  1. Object Manager: Go to Object Manager > Campaign > Buttons, Links, and Actions.
  2. New Action: Click New Action.
    • Action Type: Flow.
    • Flow: Select your new Flow.
    • Label: Send NPS Surveys.
      Button
  3. Update Page Layout:
    • Go to Campaign Page Layouts.
    • Click Mobile & Lightning Actions in the top palette.
    • Drag Send NPS Surveys into the Salesforce Mobile and Lightning Experience Actions section. Update Page Layout

Lightning page with Dynamic Actions?

If the campaign's Lightning page uses Dynamic Actions, add the action in Lightning App Builder instead of the page layout.


Troubleshooting

  • Empty Table? Ensure the Campaign Members are added as Contacts and not Leads.
  • Some contacts skipped? The result message says how many. The reasons, e.g. a contact without an email address or phone number, are logged as NPS Error records.
  • Action Missing? Ensure the nps.today package is updated to the latest version, properly licensed, and that the Apex class is accessible to the user's profile.
  • More than about 4,000 members? The loop that collects the contact IDs then needs more memory than Salesforce gives a flow. The flow stops before the confirmation screen with You or your organization has exceeded the maximum limit for this feature. For larger campaigns, use a scheduled flow on Campaign Member instead.