New Articles

  1. sgapiGetQuestionOptionSelected(%%questionID)

    This function returns the option sku for the selected answer. For multi-select questions will return an array. Example In this example, we return the option sku of a single-select question (ID 7) and a multiple-select question using sgapiGetQuest...
  2. sgapiSetPipeValues(%%questionID, %%array)

    This function question pipes the given question based on the values specified in %%array. Example The below example question pipes the array from question ID 4, a checkbox question, and question pipes question ID 5 from this array of va...
  3. sgapiGetRespondentSessionID()

    This function returns the session ID for the current response. Session ID is a unique, randomly generated string used to identify the respondent's survey session. Example %%session = sgapiGetRespondentSessionID(); %%output .= %%ses...
  4. sgapiGetTableQuestionTitles(%%questionID)

    This function accepts the Question ID of a table and returns an array in the following format: [questionID] => "title"  Example In this example we output the array of table question titles to the page. Check it out in an Example S...
  5. sgapiAllQuestionsOfType(%%type,%%pageID)

    This function returns an array of all the questions (of a particular type) on a particular page. Possible values for %%type: "RANK", "RADIO", "CHECKBOX", "TEXTBOX", "MULTI_TEXTBOX", "TABLE", "GROUP", "MENU", "LIST", "CONT_SUM" %%pageID is ...
  6. sgapiHideQuestion(%%questionID,true/false)

    This function hides when set to true and shows a question when set to false. Example In the below script we hide question ID 3 by default. Then if question 1 is "yes" it is shown by setting sgapiHideQuestion to false. sgapiHideQu...
  7. sgapiIsAnswered(%%questionID)

    This function returns Boolean true if the given question has been answered. Examples In this example, we return whether question ID 2 is answered. %%output .= sgapiIsAnswered(2) Output would be 1 if answered and null if unanswere...
  8. sgapiGetTitle(%%questionID,%%language)

    This function returns the title of a question. Using the %%language parameter you can return the title in the given language. The values are the languages available in the translation menu. %%language must be title case. Example ...
  9. sgapiRenderQuestionHTML(%%question)

    This function renders the entire question including all the HTML associated with both the question title, description and answer options. Example In the below example we output the results of sgapiRenderQuestionHTML for the below questi...
  10. sgapiIsHttps()

    This function returns a boolean for whether or not the survey link is set to secure (https). Example In the below example we're running some piece of code if the link is secure. if (sgapiIsHttps() === true{ // code } ...