Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          getSurveyFlowJson Function

          getSurveyFlowJson Function

          Searches for a survey and returns it in JSON format. Then, the presentation HTML can parse the survey and show it in the presentation player.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise and Unlimited Editions with Life Sciences Cloud, Life Sciences Cloud for Customer Engagement Add-on license, and the Life Sciences Customer Engagement managed package.

          When called, this function:

          • Validates input parameters and returns an error if the survey’s developer name is missing.
          • Loads the survey based on the developer name and the user’s access.
          • Loads the saved response, if there’s a saved survey for the current presentation and visit. If no survey response is found, the function loads a new survey.
          • Triggers the "surveyflowjsonloaded" event after the survey’s JSON data loads.
          • Shows an error for invalid requests or missing survey data.

          Parameters

          PresentationPlayer.getSurveyFlowJson(Object)

          Arguments

          Argument Description
          Object

          A JSON string in this format.

          {"developerName":"name of the survey"}

          Usage

          When survey data loads, this function triggers the "surveyflowjsonloaded" event automatically. To handle the response, register an event listener.

          Example

          PresentationPlayer.registerEventListener("surveyflowjsonloaded", function(surveyJson
                 ){ // Handle the survey JSON data
                  console.log("Survey loaded:", surveyJson);
              });
              
              // Call the function
              PresentationPlayer.getSurveyFlowJson({"developerName": "test_survey"});
           
          Loading
          Salesforce Help | Article