Deploying Surveys with Gearset

To deploy Salesforce Surveys from one org to another (or via an intermediate version control system)

Sravani Bhattiprolu avatar
Written by Sravani Bhattiprolu
Updated over a week ago

This article is the contribution of Eric Kintzer, SFDC System Architect at Helix, who is part of the Gearset DevOps Leaders Program.

Preconditions

  • The target org needs to have Surveys enabled - See Setup > Survey Settings

  • The target org for relevant users who manage Surveys will need the Surveys tab set to Default On

  • If using a new Organization-Wide Email Address to send surveys, configure and verify that email address in the target org.

Select the following metadata types

  • Flow

    • This is where your Survey can be found. Just like “normal” flows, only the most recent version is located by Gearset via the Metadata API.

  • BrandingSet

    • This corresponds to the definition of the survey’s branding

    • Each time you change a survey’s branding, a new BrandingSet is created. The names of each BrandingSet are system-generated and prefixed with sb_ followed by the Survey’s API name and look something like this: sb_mycompany_csat_6_60903e92_0c99_4807_8c3d_21ced41bb68b

    • The Flow points at this BrandingSet in this element:

      • <processMetadataValues>
        <name>BrandingSet</name>
        <value> <stringValue>sb_mycompany_csat_6_60903e92_0c99_4807_8c3d_21ced41bb68b</stringValue>
        </value>
        </processMetadataValues>
  • ContentAsset

    • There will be more than one - your logo and the background image are the most likely. The names of the ContentAssets for your logos are under your control while the name for the background Image will be system-generated as you can’t reference existing Content Assets for the background image in the Survey Builder (at least as of Winter 24). An example name for the background image will look like this: X0LwDJ000000CgMm0AK72403209_135c_464

    • The BrandingSet points at the Survey’s background image here:

      • <brandingSetProperty>
        <propertyName>backgroundImageUrl</propertyName>
        <propertyValue>X0LwDJ000000CgMm0AK72403209_135c_464</propertyValue>
        </brandingSetProperty>

Knowing which BrandingSet and ContentAsset (especially the backgroundImage) to use requires inspection of the XML within the Flow (to locate the BrandingSet) and inspection within the BrandingSet to locate the backgroundImageUrl.

Problem Analyzer and Deployment

  • Salesforce allows a deployment of a survey Flow without its BrandingSet

  • Salesforce allows a deployment of a BrandingSet without its referenced ContentAssets

  • Gearset is working on enhancing the Problem Analyzer to display warnings when these dependent metadata types are not in the source or target.

  • The Survey Flow deploys with a warning that looks like

    • p_f6448a1f_b91d_47aa_9582_d6d0773a93d8 (Screen) - "p_f6448a1f_b91d_47aa_9582_d6d0773a93d8" isn't connected to anything. (line:48)

This can be ignored.

  • Once deployed, the Survey flow will need to be activated in the Survey Builder.

Did this answer your question?