New Articles

  1. sgapiListReplace(%%surveyID, %%reponseID, %%array)

    This function replaces the given response for the given survey with the array items. This is equivalent to updating a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Example In t...
  2. API Functions

    These functions allow you to make some common API calls to the SurveyResponse object. sgapiList - This function returns the list of responses for the given survey. This is equivalent to a get list on the SurveyResponse object via the Re...
  3. sgapiTranslate(%%string,%%language)

    This function translates a string in custom scripting to the current language of the survey (or a language specified as the optional second parameter). The sgapiTranslate function creates a translation field for the specified string in the Tex...
  4. sgapiGetQuestionResponseCount

    This is a realtime reporting function. You can query the total response count for a question using the %%questionID parameter. Or, by passing an option sku in %%osku, you can return the response count for a particular answer option. You can also fil...
  5. sgapiResultsQuestionTotal(%%questionID)

    This returns the cumulative sum of all the numeric values answered for the given question ID from responses that have already been processed . This function requires numeric reporting values. The sum that is returned will not include data from...
  6. sgapiGetValueLabel(%%questionID,%%language)

    This function returns the answer option title of the selected answer option (or null, if not answered). For single-select questions, a single value is returned. Multi-select and matrix questions will return an array. Using the %%language paramet...
  7. sgapiSetValue(%%questionID,%%value)

    This function populates the response value of the given question.  For hidden value, textbox, essay, radio button, drop-down menu, slider and image choice %%value is defined as a "string." For checkbox and Drag & Drop %%value must be specified as ...
  8. sgapiGetQueryResponseCount(%%urlname)

    This function returns the number of responses (completes) that have been collected for the current survey. It takes an optional %%urlname parameter that filters by a URL variable. %%name should be in the format of: "urlvar_VariableName=Value". ...
  9. sgapiGetPipeValues(%%questionID)

    This function returns an array the piped values for the given question-piped question. Example In the below example we output the values of question ID 6 which is negative question piped from a question on a previous page. Check i...
  10. sgapiURLValue(%%urlname)

    This function returns the value of a query string variable passed into the survey where %%urlname is the name of the url variable. Note: URL variable names are stored as all lower case in our system. Example This script outpu...