API Docs for: 2.0.17170.2
Show:

ui.survey Class

Module: UI Survey
Parent Module: UI

Survey UI Module

Item Index

Methods

Methods

render

(
  • config
)
Promise static

Render the Survey UI

Parameters:

  • config ui.survey.Config

    A ui.survey.Config object

    • [uiInfo] ui.UIInfo optional

      A ui.UIInfo object

      • [type] ui.HostType optional
        A value in {{#crossLink "ui.HostType"}}{{/crossLink}} which indicates the type of UI to render e.g. IFRAME, POPUP.
      • [containerSelector] String optional
        Only required for iframe -- a JQuery selector statement to define the element into which the iframe will be loaded
      • [height] Number optional
        The height of the rendered UI
      • [width] Number optional
        The width of the rendered UI

Returns:

Promise:

A promise that resolves to a ui.survey.SDK object when the UI component has successfully loaded

Example:

// Render Survey as a POPUP.
// More UIInfo examples available here
var uiInfo = {
    type: MsSupportSdk.ui.HostType.POPUP,
    width: 600,
    height: 800
};

// Create a survey config
var config = {
    uiInfo: uiInfo
    productId: "SMC",
    surveyId: "smcsurvey",
    locale: "en-us", // All parameters down to here are required
    flightId: "abc123", // Optional flight ID. Default is empty. Used for testing. Forces the specified flight data from survey platform
    preview: false, // Optional use preview flag. Default is false. Used for testing. Uses preview compass data
    viewMode: "Wizard", // Optional view mode (Wizard | SinglePage). Default is Wizard.
    envrionment: "https://survey.support.services.microsoft.com/ViewSurvey.html", // Optional environment (survey url).
    surveyPlatformEnvironment: "Prod", // Optional default survey platform environment (Prod | PPE). Default is Prod.
    onSurveyComplete: function() {
        console.log("Survey completed");
    }
 };

// Render Survey agent UI
MsSupportSdk.ui.survey.render(config).then(
    function() {
        console.log("Survey rendered successfully.");
    },
    function(err) {
        console.log(err.message);
    });